Neuron Decay Issue in MNIST Tutorial Implementation #719
Unanswered
qianhuiliu
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The decay variables get multiplied by 4096 (2**12) before being used inside of the model. For a given value of du you want to implement, you should set the value in the neuron to int(du*4095). By setting this value to 1, you are actually setting the du value of the neuron to be du = 1/4096. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I am currently working on the MNIST tutorial https://github.com/lava-nc/lava/blob/main/tutorials/end_to_end/tutorial01_mnist_digit_classification.ipynb and attempting to develop my own model. However, I have encountered an issue related to the decay of neuron current. In the tutorial https://github.com/lava-nc/lava/blob/main/tutorials/end_to_end/tutorial00_tour_through_lava.ipynb, the LIF (Leaky Integrate-and-Fire) dynamics abstraction is presented as follows:
u[t] = u[t-1] * (1-du) + a_in # Neuron current
v[t] = v[t-1] * (1-dv) + u[t] + bias # Neuron voltage
s_out = v[t] > vth # Spike if threshold is exceeded
v[t] = 0
I made the following modifications to implement my spiking neuron:
u[t] = a_in # Neuron current
v[t] = v[t-1] * (1-dv) + u[t] + bias # Neuron voltage
s_out = v[t] > vth # Spike if threshold is exceeded
v[t] = 0
To achieve my neural dynamics, I set du = 1. However, when observing the "u" values of the first fully connected (FC) layer using the monitor in Lava, I noticed that they continue to accumulate at each timestep. This behavior is abnormal because "u" should be equal to "a_in" at each timestep. Strangely, when I set du to 4095 (the same value used in the tutorial (https://github.com/lava-nc/lava/blob/main/tutorials/end_to_end/tutorial01_mnist_digit_classification.ipynb), the "u" values of the first FC layer appear normal and remain unchanged, consistently matching "a_in" at each timestep.
Steps to Reproduce:
Follow the MNIST tutorial for implementing the LIF dynamics abstraction.
Modify the dynamics as described above to set du = 1.
Observe the "u" values of the first FC layer using a monitor.
Notice that the "u" values keep accumulating, but when du is set to 4095, the "u" values appear normal and unchanged.
Expected Behavior:
The "u" values of the first FC layer should remain stable and not accumulate regardless of the value of du when du=1.
I would greatly appreciate guidance on how to correctly set the "du" values in this context.
Beta Was this translation helpful? Give feedback.
All reactions