Why Training phase doesn't need timestep, but Testing phase does

I’m following the MNIST classification tutorial
and understand that the training data has size : batch_size x 1 x features (1 mean one timestep).
But the testing data has size: batch_size x nstep x features.
Could you please explain why they are different in nstep? And how the model learning with only 1 step but it’s possible to predict with nstep?

If my data is time series and has size batch_size x nstep x features in both the training and testing data. How should I do (just feeding training data with nstep during training or what?

Thank you!

Time is an inherent aspect of spiking neural networks. If you just run a network for one timestep, few if any of your neurons will spike and you won’t be able to make a good prediction. You need to run over time to allow the neurons to accumulate information. Thus, we take an image and repeat it for nstep timesteps.

When training, we train as a standard ANN with rate-based (non-spiking) neurons, so we don’t need multiple timesteps.

Dear Eric,

Thank you for your reply.
So I have time series dataset with shape: batch_size x nstep x features. Could you please guide or example me how to build the classification model? Because in the MNIST dataset, it has size of batch_size x 1 x features (there is no nstep in the training). How could I apply to our data in the training phase (having nstep)?

Thank you!

Hello @leminhhuy , I am not sure if you are familiar with Back-propagation Through Time (BPTT) and surrogate-derivative concept, but you can probably apply that to train your SNN on a time-series data. From the linked tutorial (in your post) I see that you are interested in directly training an SNN. I am not sure what code changes would be required in that tutorial – you can wait for the Nengo developers to respond); alternatively, you can also explore the Surrogate Gradient Descent way, related to which I have written a tutorial here.

Thank you very much for the response, Zerone! You wrote a very nice tutorial!
I’m waiting for the Nengo Engineering responses!