By default, the Nengo DL simulator will use the learning phase as set by Keras (i.e. "test" mode for predict/evaluate, and "train" mode for fit). However, sometimes it can be useful to be able to override Keras' default behaviour (e.g. if we want to use "train" mode in predict, so that we can check the output of a spiking model after its neurons are swapped to the rate equivalents).
This allows the learning phase to be overridden by setting the global Keras learning phase (using, e.g. tf.keras.backend.set_learning_phase) before the Simulator is constructed.
Also added an option to control the input values in check_gradients (for when we don't want to evaluate the gradients at zero).
By default, the Nengo DL simulator will use the learning phase as set by Keras (i.e. "test" mode for
predict/evaluate
, and "train" mode forfit
). However, sometimes it can be useful to be able to override Keras' default behaviour (e.g. if we want to use "train" mode inpredict
, so that we can check the output of a spiking model after its neurons are swapped to the rate equivalents).This allows the learning phase to be overridden by setting the global Keras learning phase (using, e.g.
tf.keras.backend.set_learning_phase
) before the Simulator is constructed.Also added an option to control the input values in
check_gradients
(for when we don't want to evaluate the gradients at zero).