Hi all,
I am fairly new to Nengo and was wondering about implementing this convolutional neural network using the Nengo library. In particular I’m wondering what arrangement of Nengo Connections can be done to create a block of Convolutional and Relu layers, and whether this can be abstracted to create a “connection module”?
I’m leaning on this utility function from the Nengo docs so far:
def conv_layer(x, *args, activation=True, **kwargs):
# create a Conv2D transform with the given arguments
conv = nengo.Convolution(*args, channels_last=False, **kwargs)
if activation:
# add an ensemble to implement the activation function
layer = nengo.Ensemble(conv.output_shape.size, 1).neurons
else:
# no nonlinearity, so we just use a node
layer = nengo.Node(size_in=conv.output_shape.size)
# connect up the input object to the new layer
nengo.Connection(x, layer, transform=conv)
# print out the shape information for our new layer
print("LAYER")
print(conv.input_shape.shape, "->", conv.output_shape.shape)
return layer, conv