-
Notifications
You must be signed in to change notification settings - Fork 341
Description
I submitted an issue #487 that explained an error I had encountered.
After investigation, I think it is not because the network parameters were set incorrectly. I replied the specific disgussion in #487.
I think this problem may have occurred in the update phase of the network rather than in the forward propagation phase of the network.
My code logic is to separate forward propagation from network updates. That is, I set self._net.train(mode = False) before calling self._net.run() as follows:
self._net.train(mode = False)
spike = self._encoder(x) # PoissonEncoder
input = {"input": spike}
self._net.run(input, self._time, one_step = True)to make the network behave like:
with torch.no_grad():
model.forward(x)in PyTorch.
My code works fine for forward propagation without any errors. But when I update network parameters as follows:
self._net.train(mode = True)
for connection in self._net.connections:
self._net.connections[connection].update(reward = reward)I get the error mentioned in #487.
The most critical error message is:
File "/usr/local/anaconda3/envs/snn_rl/lib/python3.7/site-packages/bindsnet/learning/learning.py", line 669, in _conv2d_connection_update
self.eligibility = self.eligibility.view(self.connection.w.size())
RuntimeError: shape '[32, 4, 8, 8]' is invalid for input of size 262144What is the cause of this error?
I really appreciate your help!