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
I'm building the sample Keras LeNet ANN into an SNN targeting the Brian2 backend. However, there is an error when running the build_convolution section of the conversion where conn is referenced before being defined.
defbuild_convolution(self, layer, input_weight=None):
fromsnntoolbox.simulation.utilsimportbuild_convolutiondelay=self.config.getfloat('cell', 'delay')
transpose_kernel= \
self.config.get('simulation', 'keras_backend') =='tensorflow'self._conns, self._biases=build_convolution(layer, delay,
transpose_kernel)
self.set_biases()
print("Connecting layer...")
forconninself._conns:
i=conn[0]
j=conn[1]
self.connections[-1].connect(i=i, j=j)
ifinput_weightisnotNone:
self.connections[-1].w=input_weight.flatten()
else:
# --- here conn is referenced without being defined ---self.connections[-1].w[i, j] =conn[2]
I believe the following code is appropriate to fix the issue but wanted to confirm.
This indentation error was introduced by a recent pull request and I unfortunately did not catch it in review. Thanks for noticing and proposing the parallelized approach. If you make two cosmetic changes (spaces after ,, and a linebreak before j=...), I'd be happy to pull this fix. Thank you!
I'm building the sample Keras LeNet ANN into an SNN targeting the Brian2 backend. However, there is an error when running the build_convolution section of the conversion where conn is referenced before being defined.
I believe the following code is appropriate to fix the issue but wanted to confirm.
The text was updated successfully, but these errors were encountered: