Implementing voltage-based (or other state-based) plasticity models

Questions concerning the use of Auryn classes. If you want to contribute a howto for a given example code please consider getting write access for the Dokuwiki.
Post Reply
User avatar
zenke
Site Admin
Posts: 156
Joined: Tue Oct 14, 2014 11:34 am
Location: Basel, CH
Contact:

Implementing voltage-based (or other state-based) plasticity models

Post by zenke »

To implement a voltage based plasticity model or a plasticity model which depends on any AurynStateVector of a NeuronGroup you can access postsynaptic variables directly (presynaptic variables is tricky if you want to run simulations using MPI because synapses reside on the same node as their target neuron) from within your plastic connection class.

To do so it is good practice to first create a pointer to the state vector you want to use in your plastic connection class, because the lookup of a state vector via its key string (ie. get_state_vector("xyz")) takes time and the update function needs this value O(N^2) times.
Let's consider an example. Say you want to implement the ABS rule and you need to access to the membrane potential (the procedure works for any other state vector though). First, add a member variable to your "PlasticConnection" class:

Code: Select all

AurynStateVector * post_mem;
Then in the constructor of the PlasticConnection class let this point to the postsynaptic state vector you need (you can access the postsynaptic group via "dst"), ie.

Code: Select all

post_mem = dst->get_state_vector("mem");
Then in your plastic update somewhere in the propagate function where you implement spike triggered plasticity (or in the evolve function if you implement time continuous plasticity) you just use "post_mem". For ABS this would be typically something like:

Code: Select all

// compute ABS-like update upon "pre" spike on neuron "post"
NeuronID local_id = dst->global2rank(post); // translate position in vector to current rank
float pm = post_mem->get(local_id);
float dw = 1e-3*(pm-vrest)*(pm-vthr);
I haven't tested this code, but it should be something along those lines...

I hope that makes sense.
Cheers,
F
Post Reply