Hi Xavier,

 

Actually, in your case the Prepare-Run-Cleanup approach should work, since you use SetStatus only on synaptic weights. The reason we warn about unpredictable behaviour in case of SetStatus inside a RunManager context is that Prepare() calls a pre_run_hook() on all network nodes to allow them to precompute internal variables. So if you changed neuron parameters inside an RM context, the nodes would update with an inconsistent set of externally set parameter values and internally not-updated variables. Synapses do not have such a pre-run-hook, so there you should be way safe. Note that you cannot Connect/Disconnect in a RM context, since the connection infrastructure needs to be updated by Prepare().

 

Finally, one could wonder about how the external manipulation of the synaptic weights interacts with the internal evolution of the weights through STDP, i.e., what the actual time-evolution equations for your weights become when taking normalization into account. But that is a neuroscientific question, not a NEST-technical one.

 

Best,

Hans Ekkehard

 

-- 

 

Prof. Dr. Hans Ekkehard Plesser

 

Department of Data Science

Faculty of Science and Technology

Norwegian University of Life Sciences

PO Box 5003, 1432 Aas, Norway

 

Phone +47 6723 1560

Email hans.ekkehard.plesser@nmbu.no

Home http://arken.nmbu.no/~plesser

 

 

 

From: Xavier Otazu <xotazu@cvc.uab.cat>
Date: Thursday, 8 February 2024 at 21:42
To: users@nest-simulator.org <users@nest-simulator.org>
Subject: [NEST Users] Re: Weights assignment error with mpirun

[Du mottar ikke ofte e-post fra xotazu@cvc.uab.cat. Finn ut hvorfor dette er viktig på https://aka.ms/LearnAboutSenderIdentification ]

Hi Hans,

Great news to be able to call GetConnections() just once ... it speedsA LOT my runnings (from 230-ish seconds to 90-ish) :-)

I tried the Prepare/Run/Cleanup some time ago (nice solution), but since I have to use SetStatus() to update normalized weights between Prepare() and Cleanup(), I cannot use it :-(

Best,
Xavier

Hans Ekkehard Plesser wrote:
> Hi Xavier,
>
> The result of `GetConnections()` remains valid as long as no new synapses are added or
> synapses deleted, so in your case, you only need to call it once.
> When you then do a `conn.weight`, you will get the weights at that point in time. But note
> that NEST only updates synaptic weights when a spike actually passes through the synapse,
> so you will get for each synapse the weight as it was at the end of the plasticity update
> when the most recent spike passed through that synapse.
>
> Instead of calling Simulate() repeatedly, you can also use a RunManager context for higher
> efficiency, see
> https://nest-simulator.readthedocs.io/en/stable/nest_behavior/running_simul….
>
> In case you should be wondering why global instantaneous normalization is so cumbersome in
> NEST: We have focused on support for biologically plausible networks so far and
> instantaneous global normalization is just not biologically plausible (nor physically
> feasible with a view to causality).
>
> Best,
> Hans Ekkehard
>
> --
>
> Prof. Dr. Hans Ekkehard Plesser
>
> Department of Data Science
> Faculty of Science and Technology
> Norwegian University of Life Sciences
> PO Box 5003, 1432 Aas, Norway
>
> Phone +47 6723 1560
> Email hans.ekkehard.plesser@nmbu.no<mailto:hans.ekkehard.plesser@nmbu.no>
> Home http://arken.nmbu.no/~plesser
>
>
>
> From: Xavier Otazu &lt;xotazu(a)cvc.uab.cat&gt;
> Date: Thursday, 8 February 2024 at 19:46
> To: users(a)nest-simulator.org &lt;users(a)nest-simulator.org&gt;
> Subject: [NEST Users] Re: Weights assignment error with mpirun
> [Du mottar ikke ofte e-post fra xotazu(a)cvc.uab.cat. Finn ut hvorfor dette er viktig p?
> https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi Hans,
>
> Thanks for your information. Fortunately, I do not normalize output connections (only
> input), hence, this code works for me.
>
> Another question. Take that I call nest.Simulate() inside a for loop and I want to
> normalize weights after every iteration. In order to avoid calling GetConnections() for
> every loop iteration, may I get the connections calling GetConnections() just once? May I
> safely suppose that after every Simulate() new weights of my connections (they are changed
> because I use STDP) will be available (for reading) using the same variable? An example
> code would be something like:
>
> my_conn = GetConnections(...)
>
> for iter in range(...)
>    nest.Simulate(...)
>    normalize_connections(my_conn) # function that normalizes weights and calls
> nest.SetStatus(my_conn, ...)
>
>
> Many thanks in advance!
>
> Xavier
> _______________________________________________
> NEST Users mailing list -- users(a)nest-simulator.org
> To unsubscribe send an email to users-leave(a)nest-simulator.org
_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org