Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


manual:sparseconnection

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:sparseconnection [2013/10/10 09:59]
zenke Adds howto init the connection from a file section
manual:sparseconnection [2013/11/01 16:57] (current)
Line 28: Line 28:
 Instead of the arguments ''​weight''​ and ''​sparseness''​ you can pass the ''​filename''​ argument to specify a [[wmat]] file from which the connection will be initialized. Note that particularly when running simulations in parallel this file should only contain the elements of the connection matrix that are also stored on the respective rank where the code is issued. This is generally the case if the weight matrix has been saved during a run of the same model run on the equal amount of nodes/​ranks. If this is not the case the creation of such matrices might require a more in depth understanding on how auryn distributes neurons and synapses over the existing computing resources (see also [[manual:​load balancing]]). Instead of the arguments ''​weight''​ and ''​sparseness''​ you can pass the ''​filename''​ argument to specify a [[wmat]] file from which the connection will be initialized. Note that particularly when running simulations in parallel this file should only contain the elements of the connection matrix that are also stored on the respective rank where the code is issued. This is generally the case if the weight matrix has been saved during a run of the same model run on the equal amount of nodes/​ranks. If this is not the case the creation of such matrices might require a more in depth understanding on how auryn distributes neurons and synapses over the existing computing resources (see also [[manual:​load balancing]]).
  
 +===== Loading patterns =====
  
 +Patterns can be loaded from a [[pat]] file to an existing weight matrix. Here is an example:
 +<code cpp>
 +SparseConnection * con_ee = new SparseConnection(neurons_e,​neurons_e,​wee,​sparseness);​
 +con_ee->​load_patterns("​2blocks.pat",​lambda);​
 +</​code>​
 +In this example first the connection object ''​con_ee''​ is instantiated and then a bunch patterns from the file ''​2blocks.pat''​ are added with the ''​load_patterns''​ command. By default the load patterns method will check if two respective neurons being part of one pattern have an existing connection between them. If that is the case, this connection will be augmented by the second parameter ''​lambda''​ which should be of type [[AurynWeight]]. ​
  
 +The full method is the following
 +<code cpp>
 +void load_patterns( string filename, AurynWeight strength, bool overwrite = false, bool chainmode = false);
 +void load_patterns( string filename, AurynWeight strength, int n, bool overwrite = false, bool chainmode = false);
 +</​code>​
 +where the filename always specifies the full path to the [[pat]] file. strength signifies the amount by which the weights (given the connections exists is increased) if ''​overwrite == false''​. If overwrite is set to ''​true''​ all connections are are set to exactly ''​strength''​ similar to the Willshaw model. ​
 +
 +''​chainmode''​ when enabled will write a synfire chain to the weight matrix by consecutively connecting pattern ''​n''​ with ''​n+1''​. Finally the amount of patterns loaded from the file can be limited to number ''​n''​ by setting the corresponding parameter.
manual/sparseconnection.txt ยท Last modified: 2013/11/01 16:57 (external edit)