Hello Nengo community,
I would like to extract the weights of the trained model. I have questions related to the save_params command in the NengoDl MNIST tutorial. Does this command save the weights of the model?
For instance, the network below it gives 5 NumPy arrays in the save_params file.
with nengo.Network(seed=0) as net: net.config[nengo.Ensemble].max_rates = nengo.dists.Choice() net.config[nengo.Ensemble].intercepts = nengo.dists.Choice() net.config[nengo.Connection].synapse = None neuron_type = nengo.LIF(amplitude=0.01) nengo_dl.configure_settings(stateful=False) inp = nengo.Node(np.zeros(28 * 28)) x = nengo_dl.Layer(tf.keras.layers.Dense(4))(inp, shape_in=(28* 28, 1)) x = nengo_dl.Layer(neuron_type)(x) out = nengo_dl.Layer(tf.keras.layers.Dense(units=4))(x) out_p = nengo.Probe(out, label="out_p") out_p_filt = nengo.Probe(out, synapse=0.1, label="out_p_filt")
When I unzip the save param file it gives a warning “headers error”. But it successfully extracts 5 numpy arrays. The shape of the arrays saved by save_params are: (3136,), (1, 4), (4,), (3136, 4) and (4,) respectively. If my understanding is correct, the first layer has the dimension of 3136 because 28x28 pixels are connected to 4 neurons of the first dense layer. Then dense layer output is (1,4) and (4,) is the output of LIF. Am I right? If yes, then how is the next dimension (3136,4)?
Thank you in advance for your answer.