This is an old revision of the document!
Table of Contents
WeightMonitor
This class monitors one or multiple synaptic weights over time and writes them to a human readable ASCII file.
Usage example
Consider the following examples. Assuming that you have previously define a plastic connection object con
in your simulation and you want to see what some of its synapses are doing during learning.
This will initialize a WeightMonitor object:
WeightMonitor * wmon = new WeightMonitor( con, sys->fn("con","syn"), 0.1);
The first argument is the connection you want to monitor. The second one is the filename to write to (here we are using the fn
, for filename, function provided by the Auryn kernel that will generate a suitable filename for each rank). The third argument is the sampling interval in seconds.
WeightMonitor maintains a list of connections to monitor. Initially this list is empty. There are multiple ways of telling Weight Monitor which ones to monitor.
Monitoring a subset of random weights
wmon->add_equally_spaced(20);
This adds 20 weights to the list which are equally spaced in memory. For most purposes of random connectivity matrices you can think of them as a set of random weights.
Adding a specific synaptic connection
If you are interested in a specific synaptic connection, you can add it to the list using
wmon->add_to_list( i, j );
or if you have a pointer ptr
pointing to this synaptic weight:
wmon->add_to_list( ptr );
is also permitted.
Structured connections
Suppose you want to monitor the weights between population of neurons. For instance, connections within a cell assembly or the connections between them. You can do this with
wmon->load_pattern_connections(filename);
where filename
is the path to a file which looks like this:
0 1 2 3 4 5 6 7 8 9
The WeightMonitor will read the above file as two “patterns”, two subpopulations consisting of 5 neurons each. Let's call them p1=(0,1,2,3,4) and p2=(5,6,7,8,9). Per default it wall add 5 weights for each possible connection between the two populations to the list. I.e. there will be 5 weights corresponding to self connections between neurons in p1. The next 5 weights will be connections from p1 to p2. The next 5 p2 to p2 and then p2 to p1.
There is a similar function which takes two filenames and allows you to load the structure of SynFireChains into the WeightMonitor.
For additional ways of loading weights to the least also see: http://www.fzenke.net/auryn/doxygen/current/classauryn_1_1WeightMonitor.html