Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


tutorials:multiple_synaptic_state_variables

This is an old revision of the document!


Tutorial: Multiple Synaptic State Variables

Let's assume you would like to write a plasticity model in which induced changes to a synapse require some time to percolate through. Consider that inserting for instance additional AMPA receptors into a postsynaptic density takes time…

Aims

Our aim is to introduce a meta-variable s on which STDP acts, but the actual weight of the connection is w a low-pass filtered version of s. Doing so will require to store both variables for each synapse. Therefore, each synapse possesses two states that it will need to keep track of. Currently, Auryn does not provide matrix classes which implement this directly. Therefore, we need do things manually.

Walk-through

To achieve our aim we will base this tutorial on the TripletConnection which implements the minimal triplet model by Pfister and Gerstner (2006). In the following we will address these steps:

  1. We will copy and rename TripletConnection into a new class called LPTripletConnection
  2. We will then insert a second SimpleMatrix matrix container into the class which will hold our meta-variable s
  3. All plasticity related STDP call will then be refined to act on this new variables s
  4. Finally we will implement an evolve function for the connection in which we implement the low pass filtering of s to yield w.

Copying TripletSTDPConnection source files

To prepare our new class we start by navigating to Auryn's src directory. And then copying TripletConnection.h and TripletConnection.cpp to LPTripletConnection.h and LPTripletConnection.cpp respectively. Note, that you can name the class differently, but you will have to stick with then new name you choose throughout this walk-through. Here, I simply put LP for low-pass, but a shorter or different name might seem more appropriate for you.

zenke@cashew:~/auryn/src$ cp TripletConnection.h LPTripletConnection.h
zenke@cashew:~/auryn/src$ cp TripletConnection.cpp LPTripletConnection.cpp

Once the files are copied, open them in your preferred browser and replace all occurrences of TripletConnection with LPTripletConnection. Make sure to also replace the include guards in the header file which are in all caps TRIPLETCONNECTION_H_ becomes LPTRIPLETCONNECTION_H_. Congrats! At this point it should be possible to build Auryn with the new object. However, so far we have not really implemented any new functionality. The new class will therefore behave exactly the same way as the original TripletConnection.

Now is generally a good time to start updating the doxygen string in the header file just above the keyword class. Add a short description of what you are planning to do with this connection, otherwise this is only forgotten later and you will have created ambiguous documentation which is only going to confuse you later.

Adding a second SimpleMatrix container

To store synaptic weights Auryn uses the class SimpleMatrix. The simple denotes that it can hold only a single value (a ComplexMatrix is planned for one of the downstream revisions of Auryn, but not implemented yet). Since we only need a second value to store the ongoing plasticity effects (the one we called s so far), we will just go with not so need, but fully functional solution of using two SimpleMatrix instances.

First add the following line to the private variable declarations in the newly created header (.h) file

private:
    ForwardMatrix * s_matrix;

Then open the .cpp file and find the function init(). At the end of this function add the following code which will instantiate our new s_matrix

s_matrix = new ForwardMatrix ( w );

This tells Auryn to create a matrix and clone all its properties (such as dimensions, sparseness, etc) from w which is the default name of the weight matrix in all sparse connections (i.e. also the descendants of SparseConnection). As a next step find the function free() in the .cpp file and add the line

delete s_matrix;
tutorials/multiple_synaptic_state_variables.1418632389.txt.gz · Last modified: 2014/12/15 08:33 by zenke