manual:weightmonitor
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
manual:weightmonitor [2016/07/05 06:02] – created zenke | manual:weightmonitor [2017/04/24 19:14] (current) – Changes links to fzenke.net zenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Sorry, this page is still missing. Your best bet on finding information on this is to go to | + | ====== WeightMonitor ====== |
- | http:// | + | |
- | or to look at the source | + | This class monitors one or multiple synaptic weights over time and writes them to a human readable ASCII file. |
+ | For the full class reference see its | ||
+ | [[http:// | ||
+ | ===== Usage example ===== | ||
+ | |||
+ | Consider the following examples. Assuming that you have previously define a plastic connection object '' | ||
+ | |||
+ | This will initialize a WeightMonitor object: | ||
+ | <code c++> | ||
+ | WeightMonitor * wmon = new WeightMonitor( con, sys-> | ||
+ | </ | ||
+ | |||
+ | The first argument is the connection you want to monitor. The second one is the filename to write to (here we are using the '' | ||
+ | WeightMonitor maintains a list of connections to monitor. Initially | ||
+ | |||
+ | |||
+ | ==== Monitoring a subset of random weights ==== | ||
+ | |||
+ | <code c++> | ||
+ | wmon-> | ||
+ | </ | ||
+ | |||
+ | 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 the pre and post indices ([[NeuronID]]) | ||
+ | <code c++> | ||
+ | wmon-> | ||
+ | </ | ||
+ | or if you have a pointer '' | ||
+ | <code c++> | ||
+ | wmon-> | ||
+ | </ | ||
+ | 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-> | ||
+ | </ | ||
+ | where '' | ||
+ | < | ||
+ | 0 | ||
+ | 1 | ||
+ | 2 | ||
+ | 3 | ||
+ | 4 | ||
+ | |||
+ | |||
+ | |||
+ | 5 | ||
+ | 6 | ||
+ | 7 | ||
+ | 8 | ||
+ | 9 | ||
+ | </ | ||
+ | |||
+ | The WeightMonitor will read the above file as two " | ||
+ | |||
+ | There is a similar function which takes two filenames and allows you to load the structure of SynFireChains into the WeightMonitor. | ||
+ | |||
+ | |||
+ | ==== Adding a list of connections ==== | ||
+ | |||
+ | Alternatively you can add a list of neurons to the list as follows: | ||
+ | <code c++> | ||
+ | int psize = 100; // block size | ||
+ | WeightMonitor * wmon = new WeightMonitor( con, sys-> | ||
+ | for ( int i = 0 ; i < 5 ; ++i ) { | ||
+ | for ( int j = 0 ; j < 5 ; ++j ) { | ||
+ | std:: | ||
+ | sublist.resize(50); | ||
+ | wmon-> | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | For additional ways of loading weights to the least also see: | ||
+ | http:// | ||
+ | |||
+ | |||
+ | |||
+ | ===== Output format ===== | ||
+ | |||
+ | The WeightMonitor writes column formatted ASCII files with floating point values that can be read by most plotting tools which can process CSV and Python (numpy) or MATLAB. Per convention the first column holds the simulation time in seconds and the consecutive columns are the corresponding weight values in the order as they have been added to the list. | ||
+ | |||
+ | This is shown in the example below. | ||
+ | < | ||
+ | 30.000000 1.600000e-01 1.600000e-01 | ||
+ | 30.100000 1.600000e-01 1.600000e-01 | ||
+ | 30.200000 1.600000e-01 1.600000e-01 | ||
+ | 30.300000 1.600000e-01 1.600000e-01 | ||
+ | 30.400000 1.600000e-01 1.600000e-01 | ||
+ | 30.500000 1.600000e-01 1.600000e-01 | ||
+ | 30.600000 1.600000e-01 1.600000e-01 | ||
+ | 30.700000 1.600000e-01 1.600000e-01 | ||
+ | 30.800000 1.600000e-01 1.599996e-01 | ||
+ | 30.900000 1.600000e-01 1.599996e-01 | ||
+ | 31.000000 1.600000e-01 1.599996e-01 | ||
+ | 31.100000 1.600000e-01 1.599996e-01 | ||
+ | 31.200000 1.600000e-01 1.599996e-01 | ||
+ | 31.300000 1.600000e-01 1.599996e-01 | ||
+ | 31.400000 1.600000e-01 1.599996e-01 | ||
+ | 31.500000 1.600000e-01 1.693685e-01 | ||
+ | 31.600000 1.600000e-01 1.691309e-01 | ||
+ | 31.700000 1.600000e-01 1.691309e-01 | ||
+ | 31.800000 1.600000e-01 1.691309e-01 | ||
+ | 31.900000 1.600000e-01 1.691309e-01 | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Which can be plotted easily (for instance with | ||
+ | https:// | ||
+ | {{ : | ||
+ | The above example was recorded with [[examples: |
manual/weightmonitor.1467698566.txt.gz · Last modified: 2016/07/05 06:02 by zenke