sPyNNaker icon indicating copy to clipboard operation
sPyNNaker copied to clipboard

Allow weights to be read during simulation

Open rowleya opened this issue 4 years ago • 2 comments

In the current code, it is possible only to read the weights once the simulation is completed. This is due to a check in Projection that the simulation "has_run". If the read is done between calling run and before the run has finished (this is particularly possible when run_forever has been called and another thread does the reading), the weights will not ever be read because of this check. It should instead check somehow that the weights have been generated already, and if so, read them straight from the machine.

rowleya avatar Feb 22 '21 08:02 rowleya

I can see such a call necessarily having to have two different results depending on whether a simulation has started on the machine (which is different from having called run(..)), as it's only at that point that I think you can guarantee the weights will be available. I suppose if you know that weights have been generated using the synapse expander then that could be another point where weights might be readable. (Ignoring for now cases which use STDP, of course...)

I presume this is in some way related to the NRP? Do we have an example script available to us?

andrewgait avatar Mar 01 '21 15:03 andrewgait

It was on the NRP, although we since have a "workaround" (probably the better solution really if we want it to be faster) of sending spikes through the connection and then looking at the result in terms of spikes or membrane voltage, so no example script exists. An example would have to use something like "run_forever" and then in a separate thread after it is guaranteed that the run has started (through a callback maybe), read the synapses.

rowleya avatar Mar 01 '21 15:03 rowleya