You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nengo.Convolution supports many of the same arguments and options as its keras counterpart. However there is no groups parameter in nengo as in the keras docs for Conv2D.
A groups paramter would be useful to allow for more robust conversions between keras networks and nengo networks via the dl converter. This would also allow people to implement depthwise convolutions with ease also in nengo.
The text was updated successfully, but these errors were encountered:
It seems to fix this method you have to add a groups parameter to the conv2d function found here
This is my fix:
def conv2d(x, w, pad='SAME', stride=(1, 1), groups = 1):
ksize = w.shape[:2]
x = extract_sliding_windows(x, ksize, pad, stride)
ws = w.shape
w = w.reshape([ws[0] * ws[1] * ws[2], ws[3]])
xs = x.shape
if groups == 1:
x = x.reshape([xs[0] * xs[1] * xs[2], -1])
else:
x = x.reshape([xs[0] * xs[1] * xs[2], groups, -1]) # seperate input into groups
y = x.dot(w) # convolve all
if groups > 1:
y = np.sum(y, -2) # sum up along groups
y = y.reshape([xs[0], xs[1], xs[2], -1])
return y
Then you have to manually edit or extend ConvInc found here to use the groups parameter
You have to modify the convolution transform found here and register it with the Builder.
I may edit and elaborate on this process in the coming weeks
nengo.Convolution supports many of the same arguments and options as its keras counterpart. However there is no groups parameter in nengo as in the keras docs for Conv2D.
A groups paramter would be useful to allow for more robust conversions between keras networks and nengo networks via the dl converter. This would also allow people to implement depthwise convolutions with ease also in nengo.
The text was updated successfully, but these errors were encountered: