Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


tutorials:multiple_synaptic_state_variables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:multiple_synaptic_state_variables [2014/12/15 08:33] zenketutorials:multiple_synaptic_state_variables [2016/08/18 16:58] (current) – Removes old tutorial zenke
Line 3: Line 3:
 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... 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 =====+**Update** As of Auryn 0.5 synapse models with multiple states can be implemented more easily using synaptic state vectors -- see for [[examples:sim_bg_lowpass]] in the example directory to get an idea.
  
-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 ===== +I still owe a tutorial for that here. The [[old complex synapse tutorial]] can be found here which describes the procedure before v0.7.
- +
-To achieve our aim we will base this tutorial on the [[manual:TripletConnection]] which implements the minimal triplet model by Pfister and Gerstner (2006). In the following we will address these steps: +
-  - We will copy and rename ''TripletConnection'' into a new class called ''LPTripletConnection'' +
-  - We will then insert a second [[manual:SimpleMatrix]] matrix container into the class which will hold our meta-variable ''s'' +
-  - All plasticity related STDP call will then be refined to act on this new variables ''s'' +
-  - 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. +
- +
-<code shell> +
-zenke@cashew:~/auryn/src$ cp TripletConnection.h LPTripletConnection.h +
-zenke@cashew:~/auryn/src$ cp TripletConnection.cpp LPTripletConnection.cpp +
-</code> +
- +
-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 [[manual: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 [[manual:SimpleMatrix]]. The simple denotes that it can hold only a single value (a [[manual: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 [[manual:SimpleMatrix]] instances. +
- +
-First add the following line to the private variable declarations in the newly created header (.h) file +
-<code cpp> +
-private: +
-    ForwardMatrix * s_matrix; +
-</code> +
-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'' +
-<code cpp> +
-s_matrix = new ForwardMatrix ( w ); +
-</code> +
-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.ealso the descendants of [[manual:SparseConnection]]). As a next step find the function ''free()'' in the .cpp file and add the line +
-<code cpp> +
-delete s_matrix; +
-</code>+
tutorials/multiple_synaptic_state_variables.1418632389.txt.gz · Last modified: 2014/12/15 08:33 by zenke