Hi everyone, I have just started to use nengo and I have a quick question. I have recently trained my image dataset by using SNN. I want to know how to obtain the history of accuracy and loss changes from the simulator object “sim” which i have trained. It would be really great if you can answer my question. Thanks in advance
Hi @JoshuaAlfred, and welcome to the Nengo forums!
You didn’t specify, but since you are talking about training models, I am assuming you are using NengoDL? If you are, there are a couple of ways to get the history of accuracy and loss changes. The first is to probe and record the changes manually (e.g., by appending the values to an list), which is how a user has done it in their forum post.
Alternatively, since the backend for NengoDL is TensorFlow, you can use Tensorboard to record all of this information for you. The sim.fit
, sim.eval
, sim.compile
function are essentially wrappers for their respective TensorFlow functions (model.fit
, model.eval
, etc.,), so any TensorFlow process used to probe and record accuracy and loss figures will also work with NengoDL.
If you haven’t used Tensorboard, it is fairly straightforward to use, and you can read about the process here. When using Tensorboard with NengoDL, the important step is to set up the Tensorboard callbacks so that when you call sim.fit
, NengoDL (and in the backend, TensorFlow) will know where to log the data to.
I should note that you have to set up the logging process prior to the training run. If you have already done the training without the logging processes in place, I don’t think it is possible to get the accuracy and loss histories from that (you’ll need to re-run the training process).