genn-team / ml_genn

A library for deep learning with Spiking Neural Networks (SNN).
https://ml-genn.readthedocs.io
GNU Lesser General Public License v2.1
24 stars 7 forks source link

Get raw predictions from CompiledInferenceNetwork #84

Closed neworderofjamie closed 11 months ago

neworderofjamie commented 11 months ago

As ever, have taken inspiration from Keras for this but to obtain raw predictions rather than evaluate metrics from an inference network you do:

predictions, _ = compiled_net.predict({input: testing_images * 0.01},
                                      output)

rather than:

metrics, _ = compiled_net.evaluate({input: testing_images * 0.01},
                                   {output: testing_labels})

The result will be a dictionary mapping output populations to (dataset_size, num_output_neurons) numpy arrays containing the raw readout values i.e. spike counts or average var value