Auryn simulator
v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
|
The base class to create sparse random connections. More...
#include <SparseConnection.h>
Public Member Functions | |
SparseConnection () | |
Empty constructor which should not be used – TODO should be deprecated at some point. More... | |
SparseConnection (const char *filename) | |
Load from wmat file constructor which should not be used – TODO should be deprecated at some point. More... | |
SparseConnection (NeuronID rows, NeuronID cols) | |
Deprecated constructor for manual filling. More... | |
SparseConnection (SpikingGroup *source, NeuronGroup *destination, const char *filename, TransmitterType transmitter=GLUT) | |
Deprecated constructor for loading from file. More... | |
SparseConnection (SpikingGroup *source, NeuronGroup *destination, TransmitterType transmitter=GLUT, string name="SparseConnection") | |
Constructor for manual filling. More... | |
SparseConnection (SpikingGroup *source, NeuronGroup *destination, AurynWeight weight, AurynDouble sparseness=0.05, TransmitterType transmitter=GLUT, string name="SparseConnection") | |
Default constructor which sets up a random sparse matrix with fixed weight between the source and destination group. More... | |
SparseConnection (SpikingGroup *source, NeuronGroup *destination, SparseConnection *con, string name="SparseConnection") | |
This constructor tries to clone a connection by guessing all parameters except source and destination from another connection instance. More... | |
SparseConnection (SpikingGroup *source, NeuronGroup *destination, AurynWeight weight, AurynDouble sparseness, NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, TransmitterType transmitter=GLUT) | |
Sparse block constructor. More... | |
virtual | ~SparseConnection () |
The default destructor. More... | |
void | allocate_manually (AurynLong expected_size) |
Is used whenever memory has to be allocated manually. Automatically adjusts for number of ranks and for security margin. More... | |
AurynLong | estimate_required_nonzero_entires (AurynLong nonzero, double sigma=5.) |
This function estimates the required size of the nonzero entry buffer. More... | |
void | seed (NeuronID randomseed) |
This function seeds the pseudo random number generator for all random fill operatios. More... | |
virtual AurynWeight | get (NeuronID i, NeuronID j) |
Returns weight value of a given element if it exists. More... | |
virtual AurynWeight * | get_ptr (NeuronID i, NeuronID j) |
Returns pointer to given weight element if it exists. Returns NULL if element does not exist. More... | |
virtual AurynWeight | get_data (NeuronID i) |
Returns weight value of a given element referenced by index in the data array. More... | |
virtual void | set_data (NeuronID i, AurynWeight value) |
Sets weight value of a given element referenced by its index in the data array. More... | |
virtual void | set (NeuronID i, NeuronID j, AurynWeight value) |
Sets a single connection to value if it exists. More... | |
virtual void | set (std::vector< neuron_pair > element_list, AurynWeight value) |
Sets a list of connection to value if they exists. More... | |
void | random_data (AurynWeight mean, AurynWeight sigma) |
Synonym for random_data. More... | |
void | random_data_normal (AurynWeight mean, AurynWeight sigma) |
Set weights of all existing connections randomly using a normal distrubtion. More... | |
void | random_data_lognormal (AurynWeight m, AurynWeight s) |
Set weights of all existing connections randomly using a lognormal distribution. More... | |
void | init_random_binary (AurynFloat prob=0.5, AurynWeight wlo=0.0, AurynWeight whi=1.0) |
Initialize with random binary at wlo and whi. More... | |
void | random_col_data (AurynWeight mean, AurynWeight sigma) |
Sets weights in cols to the same value drewn from a Gaussian distribution. More... | |
void | set_block (NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, AurynWeight weight) |
Sets all weights of existing connections in a block spanned by the first 4 parameters to the value given. More... | |
void | scale_block (NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, AurynWeight alpha) |
Scale all weights of existing connections in a block spanned by the first 4 parameters to the value given. More... | |
virtual void | set_all (AurynWeight weight) |
Sets all weights of existing connections to the given value. More... | |
virtual void | scale_all (AurynFloat value) |
Scales all weights in the weight matrix with the given value. More... | |
virtual void | clip (AurynWeight lo, AurynWeight hi) |
Clip weights. More... | |
void | set_upper_triangular (AurynWeight weight) |
Sets weights in a upper triangular matrix. More... | |
virtual void | sparse_set_data (AurynDouble sparseness, AurynWeight value) |
Sets a sparse random subset of connection elements wight the given value. More... | |
void | connect_random (AurynWeight weight=1.0, AurynDouble sparseness=0.05, bool skip_diag=false) |
Connect src and dst SpikingGroup and NeuronGroup randomly with given sparseness. More... | |
void | connect_block_random (AurynWeight weight, AurynDouble sparseness, NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col, bool skip_diag=false) |
Underlying sparse fill method. More... | |
virtual void | finalize () |
Finalizes connection after random or manual initialization of the weights. More... | |
bool | push_back (NeuronID i, NeuronID j, AurynWeight weight) |
Pushes a single element to the ComplexMatrix. More... | |
AurynLong | get_nonzero () |
Returns number of nonzero elements in this SparseConnection. More... | |
void | put_pattern (type_pattern *pattern, AurynWeight strength, bool overwrite) |
Puts cell assembly to existing sparse weights. More... | |
void | put_pattern (type_pattern *pattern1, type_pattern *pattern2, AurynWeight strength, bool overwrite) |
Puts cell assembly or synfire pattern to existing sparse weights. More... | |
void | load_patterns (string filename, AurynWeight strength, int nb_max_patterns=10000, bool overwrite=false, bool chainmode=false) |
Reads first n patterns from a .pat file and adds them as Hebbian assemblies onto an existing weight matrix. More... | |
void | load_pre_post_patterns (std::string pre_file, std::string post_file, AurynWeight strength, int nb_max_patterns=10000, bool overwrite=false) |
Reads patterns from two files and connects them. More... | |
virtual void | propagate () |
Internally used propagate method. More... | |
void | sanity_check () |
Quick an dirty function that checks if all units on the local rank are connected. More... | |
virtual AurynDouble | sum () |
Computes sum of all weight elements in the Connection. More... | |
virtual void | stats (AurynDouble &mean, AurynDouble &std) |
Computes mean and variance of weights in default weight matrix. More... | |
virtual void | stats (AurynDouble &mean, AurynDouble &std, NeuronID zid) |
Computes mean and variance of weights for matrix state zid. More... | |
bool | write_to_file (ForwardMatrix *m, string filename) |
Writes rank specific weight matrix on the same rank to a file. More... | |
virtual bool | write_to_file (string filename) |
Writes rank specific default weight matrix on the same rank to a file. More... | |
virtual bool | load_from_complete_file (string filename) |
Loads weight matrix from a single file. More... | |
virtual bool | load_from_file (string filename) |
Loads weight matrix from Matrix Market (wmat) file. More... | |
bool | load_from_file (ForwardMatrix *m, string filename, AurynLong data_size=0) |
Loads weight matrix from Matrix Market (wmat) file to specified weight matrix. More... | |
virtual void | set_min_weight (AurynWeight minimum_weight) |
Sets minimum weight (for plastic connections). More... | |
AurynWeight | get_min_weight () |
Gets minimum weight (for plastic connections). More... | |
virtual void | set_max_weight (AurynWeight maximum_weight) |
Sets maximum weight (for plastic connections). More... | |
AurynWeight | get_max_weight () |
Gets maximum weight (for plastic connections). More... | |
std::vector< neuron_pair > | get_block (NeuronID lo_row, NeuronID hi_row, NeuronID lo_col, NeuronID hi_col) |
Returns a vector of ConnectionsID of a block specified by the arguments. More... | |
std::vector< neuron_pair > | get_post_partners (NeuronID i) |
Returns a vector of ConnectionsID of postsynaptic parterns of neuron i. More... | |
std::vector< neuron_pair > | get_pre_partners (NeuronID j) |
Returns a vector of ConnectionsID of presynaptic parterns of neuron i. More... | |
Public Member Functions inherited from auryn::Connection | |
Connection () | |
Connection (NeuronID rows, NeuronID cols) | |
Connection (SpikingGroup *source, NeuronGroup *destination, TransmitterType transmitter=GLUT, std::string name="Connection") | |
virtual | ~Connection () |
void | set_size (NeuronID i, NeuronID j) |
void | set_name (std::string name) |
Set name of connection. More... | |
std::string | get_name () |
Returns name of connection. More... | |
std::string | get_file_name () |
Extracts the class name of the connection from the file name. More... | |
std::string | get_log_name () |
Returns a string which is the combination of file and connection name for logging. More... | |
AurynStateVector * | get_target_vector () |
Returns target state vector if one is defined. More... | |
NeuronID | get_m_rows () |
Get number of rows (presynaptic) in connection. More... | |
NeuronID | get_n_cols () |
Get number of columns (postsynaptic) in connection. More... | |
TransmitterType | get_transmitter () |
Returns transmitter type. More... | |
void | set_target (AurynWeight *ptr) |
Sets target state of this connection directly via a pointer. More... | |
void | set_target (AurynStateVector *ptr) |
Sets target state of this connection directly via a StateVector. More... | |
void | set_receptor (AurynStateVector *ptr) |
Same as set_target. More... | |
void | set_transmitter (AurynStateVector *ptr) |
Same as set_target. More... | |
void | set_transmitter (TransmitterType transmitter) |
Sets target state of this connection for a given receptor as one of Auryn's default transmitter types. More... | |
void | set_receptor (string state_name) |
Sets target state of this connection directly the name of a state vector. More... | |
void | set_target (string state_name) |
Same as set_receptor. More... | |
void | set_transmitter (string state_name) |
Same as set_receptor, but DEPRECATED. More... | |
void | set_source (SpikingGroup *source) |
Sets source SpikingGroup of this connection. More... | |
SpikingGroup * | get_source () |
Returns pointer to the presynaptic group. More... | |
void | set_destination (NeuronGroup *source) |
Sets destination SpikingGroup of this connection. More... | |
NeuronGroup * | get_destination () |
Returns pointer to the postsynaptic group. More... | |
virtual void | evolve () |
Evolve method to update internal connection state. Called by System run method. More... | |
void | conditional_propagate () |
DEPRECATED. (Such connections should not be registered in the first place) Calls propagate only if the postsynaptic NeuronGroup exists on the local rank. More... | |
Trace * | get_pre_trace (const AurynDouble tau) |
Returns a pointer to a presynaptic trace object. More... | |
Trace * | get_post_trace (const AurynDouble tau) |
Returns a pointer to a postsynaptic trace object. More... | |
Trace * | get_post_state_trace (const string state_name, const AurynDouble tau, const AurynDouble jump_size=0.0) |
Returns a pointer to a postsynaptic state trace object. More... | |
void | transmit (const NeuronID id, const AurynWeight amount) |
Default way to transmit a spike to a postsynaptic partner. More... | |
void | targeted_transmit (SpikingGroup *target_group, AurynStateVector *target_state, const NeuronID id, const AurynWeight amount) |
Transmits a spike to a given target group and state. More... | |
void | safe_transmit (NeuronID id, AurynWeight amount) |
Same as transmit but first checks if the target neuron exists and avoids segfaults that way (but it's also slower). More... | |
SpikeContainer * | get_pre_spikes () |
Supplies pointer to SpikeContainer of all presynaptic spikes. More... | |
SpikeContainer * | get_post_spikes () |
Returns pointer to SpikeContainer for postsynaptic spikes on this node. More... | |
void | add_number_of_spike_attributes (int x) |
Set up spike delay to accomodate x additional spike attributes. More... | |
AurynFloat | get_spike_attribute (const NeuronID i, const int attribute_id=0) |
Returns spike attribute belonging to the spike at position i in the get_spikes() SpikeContainer. More... | |
Public Attributes | |
bool | patterns_ignore_gamma |
Switch that toggles for the load_patterns function whether or not to use the intensity (gamma) value. Default is false. More... | |
NeuronID | patterns_every_pre |
The every_pre parameter allows to skip presynaptically over pattern IDs when loading patterns. Default is 1. This can be useful to when loading patterns into the exc->inh connections and there significantly less inhibitory cells than exc ones. More... | |
NeuronID | patterns_every_post |
The every_post parameter allows to skip postsynaptically over pattern IDs when loading patterns. Default is 1. This can be useful to when loading patterns into the exc->inh connections and there significantly less inhibitory cells than exc ones. More... | |
bool | wrap_patterns |
Switch that toggles the behavior when loading a pattern to wrap neuron IDs back onto existing cells via the modulo function. More... | |
ForwardMatrix * | w |
A pointer that points per default to the ComplexMatrix that stores the connectinos. More... | |
Public Attributes inherited from auryn::Connection | |
SpikingGroup * | src |
Pointer to the source group of this connection. More... | |
NeuronGroup * | dst |
Pointer to the destination group of this connection. More... | |
Protected Member Functions | |
void | virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version) |
void | virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version) |
void | free () |
void | allocate (AurynLong bufsize) |
std::vector< type_pattern > | load_pattern_file (string filename, int nb_max_patterns) |
Reads patterns from a .pat file and returns a vector with the patterns. More... | |
Protected Member Functions inherited from auryn::Connection | |
void | init (TransmitterType transmitter=GLUT) |
Protected Attributes | |
AurynWeight | wmin |
AurynWeight | wmax |
bool | skip_diagonal |
Protected Attributes inherited from auryn::Connection | |
TransmitterType | trans |
AurynStateVector * | target_state_vector |
AurynFloat * | target |
A more direct reference on the first element of the target_state_vector. More... | |
NeuronID | number_of_spike_attributes |
Number of spike attributes to expect with each spike transmitted through this connection. More... | |
NeuronID | spike_attribute_offset |
Stores spike attribute offset in attribute array. More... | |
Static Protected Attributes | |
static boost::mt19937 | sparse_connection_gen = boost::mt19937() |
The base class to create sparse random connections.
This direct derivative of the virtual Connection type is the most commonly used class to create connections in Auryn. It makes use of the ComplexMatrix container to memory efficiently store synaptic weights and to make them easily accessible in a feed-forward manner for spike propagation.
Most plastic connection types such as TripletConnection inherit from SparseConnecion via the intermediate Duplexconnection.
auryn::SparseConnection::SparseConnection | ( | ) |
Empty constructor which should not be used – TODO should be deprecated at some point.
SparseConnection::SparseConnection | ( | const char * | filename | ) |
Load from wmat file constructor which should not be used – TODO should be deprecated at some point.
Deprecated constructor for manual filling.
SparseConnection::SparseConnection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
const char * | filename, | ||
TransmitterType | transmitter = GLUT |
||
) |
Deprecated constructor for loading from file.
SparseConnection::SparseConnection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
TransmitterType | transmitter = GLUT , |
||
std::string | name = "SparseConnection" |
||
) |
Constructor for manual filling.
SparseConnection::SparseConnection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
AurynWeight | weight, | ||
AurynDouble | sparseness = 0.05 , |
||
TransmitterType | transmitter = GLUT , |
||
std::string | name = "SparseConnection" |
||
) |
Default constructor which sets up a random sparse matrix with fixed weight between the source and destination group.
The constructor takes the weight and sparseness as secondary arguments. The latter allows Auryn to allocate the approximately right amount of memory inadvance. It is good habit to specify at time of initialization also a connection name and the transmitter type. Both can be set separately with set_transmitter and set_name if the function call gets too long and ugly. A connection name is often handy during debugging and the transmitter type is a crucial for obvious resons ...
SparseConnection::SparseConnection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
SparseConnection * | con, | ||
std::string | name = "SparseConnection" |
||
) |
This constructor tries to clone a connection by guessing all parameters except source and destination from another connection instance.
SparseConnection::SparseConnection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
AurynWeight | weight, | ||
AurynDouble | sparseness, | ||
NeuronID | lo_row, | ||
NeuronID | hi_row, | ||
NeuronID | lo_col, | ||
NeuronID | hi_col, | ||
TransmitterType | transmitter = GLUT |
||
) |
Sparse block constructor.
This constructor initializes the connection with random sparse weights, but only fills a "block" as specified instead of the entire matrix.
|
virtual |
The default destructor.
|
protected |
Allocates memory for a given sparse connectivity matrix. Usually ComplexMatrix or ComplexMatrix
void SparseConnection::allocate_manually | ( | AurynLong | expected_size | ) |
Is used whenever memory has to be allocated manually. Automatically adjusts for number of ranks and for security margin.
|
virtual |
Clip weights.
void SparseConnection::connect_block_random | ( | AurynWeight | weight, |
AurynDouble | sparseness, | ||
NeuronID | lo_row, | ||
NeuronID | hi_row, | ||
NeuronID | lo_col, | ||
NeuronID | hi_col, | ||
bool | skip_diag = false |
||
) |
Underlying sparse fill method.
Set dist_optimized to false and seed all ranks the same to get the same matrix independent of the number of ranks. Called internally or when you know what you are doing.
void SparseConnection::connect_random | ( | AurynWeight | weight = 1.0 , |
AurynDouble | sparseness = 0.05 , |
||
bool | skip_diag = false |
||
) |
Connect src and dst SpikingGroup and NeuronGroup randomly with given sparseness.
This function should be usually called from the constructor directly.
AurynLong SparseConnection::estimate_required_nonzero_entires | ( | AurynLong | nonzero, |
double | sigma = 5. |
||
) |
This function estimates the required size of the nonzero entry buffer.
It's typicall used internally or when you know what you are doing.
|
virtual |
Finalizes connection after random or manual initialization of the weights.
Essentially pads zeros or non-existing elements at the end of ComplexMatrix. Called interally or after manually filling matrices.
Implements auryn::Connection.
Reimplemented in auryn::TripletConnection, auryn::LPTripletConnection, auryn::MinimalTripletConnection, auryn::STDPwdConnection, auryn::TripletScalingConnection, auryn::STDPConnection, and auryn::DuplexConnection.
|
protected |
|
virtual |
Returns weight value of a given element if it exists.
Implements auryn::Connection.
std::vector< neuron_pair > SparseConnection::get_block | ( | NeuronID | lo_row, |
NeuronID | hi_row, | ||
NeuronID | lo_col, | ||
NeuronID | hi_col | ||
) |
Returns a vector of ConnectionsID of a block specified by the arguments.
|
virtual |
Returns weight value of a given element referenced by index in the data array.
Implements auryn::Connection.
|
inline |
Gets maximum weight (for plastic connections).
|
inline |
Gets minimum weight (for plastic connections).
|
virtual |
Returns number of nonzero elements in this SparseConnection.
Implements auryn::Connection.
std::vector< neuron_pair > SparseConnection::get_post_partners | ( | NeuronID | i | ) |
Returns a vector of ConnectionsID of postsynaptic parterns of neuron i.
std::vector< neuron_pair > SparseConnection::get_pre_partners | ( | NeuronID | j | ) |
Returns a vector of ConnectionsID of presynaptic parterns of neuron i.
|
virtual |
Returns pointer to given weight element if it exists. Returns NULL if element does not exist.
Implements auryn::Connection.
void SparseConnection::init_random_binary | ( | AurynFloat | prob = 0.5 , |
AurynWeight | wlo = 0.0 , |
||
AurynWeight | whi = 1.0 |
||
) |
Initialize with random binary at wlo and whi.
wlo | The lower weight value. |
whi | The higher weight value. |
prob | the probability for the higher value. |
|
virtual |
Loads weight matrix from a single file.
Since a single file might contain a lot more elements than memory required this function performs a dry run during which it counts the required number of elements. This function should be optimized to avoid on large clusters the complete hammering of the fileserver. An idea would be to let one rank do all the work and distribute the established file-counts to all the stations
|
virtual |
Loads weight matrix from Matrix Market (wmat) file.
This function expects an Auryn readable Matrix Market file such as generated by write_to_file methods which only includes weight elements which belong on this very rank. To load wmat files containing all weights indepent of rank use the load_from_complete_file method. Note that these methods only store information of the first element of a ComplexMatrix. To store all informtion of a ComplexMatrix use the mechanisms in place to save the network state which are implemented in the System class.
Implements auryn::Connection.
Reimplemented in auryn::RateModulatedConnection.
bool SparseConnection::load_from_file | ( | ForwardMatrix * | m, |
std::string | filename, | ||
AurynLong | data_size = 0 |
||
) |
Loads weight matrix from Matrix Market (wmat) file to specified weight matrix.
This function expects an Auryn readable Matrix Market file such as generated by write_to_file methods which only includes weight elements which belong on this very rank. To load wmat files containing all weights indepent of rank use the load_from_complete_file method.
|
protected |
Reads patterns from a .pat file and returns a vector with the patterns.
filename | The file to load |
nb_max_patterns | The maximum number of patterns to load. |
void SparseConnection::load_patterns | ( | std::string | filename, |
AurynWeight | strength, | ||
int | nb_max_patterns = 10000 , |
||
bool | overwrite = false , |
||
bool | chainmode = false |
||
) |
Reads first n patterns from a .pat file and adds them as Hebbian assemblies onto an existing weight matrix.
filename | The file to read the patterns from |
strength | The strength to set or add to connections within a pattern (depending on setting of overwrite) |
nb_max_patterns | The maximum number of patterns to load (default 10000) |
overwrite | Whether to add strength to each connection in the pattern or whether to set the connection to he value specified (default false) |
chainmode | If set to true the function does not create cell assemblies but a synfire chain architecture in which each pattern is connected to the next as a chain. |
void SparseConnection::load_pre_post_patterns | ( | std::string | pre_file, |
std::string | post_file, | ||
AurynWeight | strength, | ||
int | nb_max_patterns = 10000 , |
||
bool | overwrite = false |
||
) |
Reads patterns from two files and connects them.
pre_file | File containint the presynaptic patterns |
post_file | File containint the postsynaptic patterns |
strength | Synaptic strength value of a connection |
nb_max_patterns | The maximum number of patterns to load (default 10000) |
overwrite | Whether to add or set strength to each connection (default false) |
This function can be used to connect a bunch of populations in one group to different populations in another group. The two pattern files must have the same number of patterns stored.
|
virtual |
Internally used propagate method.
This method propagates spikes in the main simulation loop. Should usually not be called directly by the user.
Implements auryn::Connection.
Reimplemented in auryn::TripletConnection, auryn::LPTripletConnection, auryn::MinimalTripletConnection, auryn::STPConnection, auryn::TripletScalingConnection, auryn::STDPwdConnection, auryn::RateModulatedConnection, auryn::PairInteractionConnection, auryn::SymmetricSTDPConnection, auryn::DelayConnection, auryn::STDPConnection, auryn::ABSConnection, and auryn::TripletDecayConnection.
bool SparseConnection::push_back | ( | NeuronID | i, |
NeuronID | j, | ||
AurynWeight | weight | ||
) |
Pushes a single element to the ComplexMatrix.
Note that Auryn sparse matrices need to be filled row by row in column increasing order (similar to writing in a text document). Hence, usually this function is called internally during weight initialization through a connect_random method. However, it can also be invoked manually to build custum weight matrices on the fly. The recommended method however is to build specific weight matrices in another high level programming language such as Python and to save the in the Auryn specific Matrix Market format which can then be loaded using load_from_file or load_from_complete_file methods.
void SparseConnection::put_pattern | ( | type_pattern * | pattern, |
AurynWeight | strength, | ||
bool | overwrite | ||
) |
Puts cell assembly to existing sparse weights.
TODO add more explanation here.
void SparseConnection::put_pattern | ( | type_pattern * | pattern1, |
type_pattern * | pattern2, | ||
AurynWeight | strength, | ||
bool | overwrite | ||
) |
Puts cell assembly or synfire pattern to existing sparse weights.
TODO add more explanation here.
void SparseConnection::random_col_data | ( | AurynWeight | mean, |
AurynWeight | sigma | ||
) |
Sets weights in cols to the same value drewn from a Gaussian distribution.
void SparseConnection::random_data | ( | AurynWeight | mean, |
AurynWeight | sigma | ||
) |
Synonym for random_data.
void SparseConnection::random_data_lognormal | ( | AurynWeight | m, |
AurynWeight | s | ||
) |
Set weights of all existing connections randomly using a lognormal distribution.
void SparseConnection::random_data_normal | ( | AurynWeight | mean, |
AurynWeight | sigma | ||
) |
Set weights of all existing connections randomly using a normal distrubtion.
void SparseConnection::sanity_check | ( | ) |
Quick an dirty function that checks if all units on the local rank are connected.
|
virtual |
Scales all weights in the weight matrix with the given value.
void SparseConnection::scale_block | ( | NeuronID | lo_row, |
NeuronID | hi_row, | ||
NeuronID | lo_col, | ||
NeuronID | hi_col, | ||
AurynWeight | alpha | ||
) |
Scale all weights of existing connections in a block spanned by the first 4 parameters to the value given.
void SparseConnection::seed | ( | NeuronID | randomseed | ) |
This function seeds the pseudo random number generator for all random fill operatios.
|
virtual |
Sets a single connection to value if it exists.
Implements auryn::Connection.
|
virtual |
Sets a list of connection to value if they exists.
|
virtual |
Sets all weights of existing connections to the given value.
void SparseConnection::set_block | ( | NeuronID | lo_row, |
NeuronID | hi_row, | ||
NeuronID | lo_col, | ||
NeuronID | hi_col, | ||
AurynWeight | weight | ||
) |
Sets all weights of existing connections in a block spanned by the first 4 parameters to the value given.
|
virtual |
Sets weight value of a given element referenced by its index in the data array.
|
virtual |
Sets maximum weight (for plastic connections).
Reimplemented in auryn::TripletScalingConnection, and auryn::STDPwdConnection.
|
virtual |
void SparseConnection::set_upper_triangular | ( | AurynWeight | weight | ) |
Sets weights in a upper triangular matrix.
|
virtual |
Sets a sparse random subset of connection elements wight the given value.
|
virtual |
Computes mean and variance of weights in default weight matrix.
Returns mean and variance of default weight matrix (typically referenced as w in a given SparseConnection
Reimplemented in auryn::RateModulatedConnection.
|
virtual |
Computes mean and variance of weights for matrix state zid.
Implements auryn::Connection.
|
virtual |
Computes sum of all weight elements in the Connection.
|
inlineprotectedvirtual |
Serialization function for saving the Connection state. Implement in derived classes to save additional information.
Reimplemented from auryn::Connection.
|
inlineprotectedvirtual |
Serialization function for loading the Connection state. Implement in derived classes to save additional information.
Reimplemented from auryn::Connection.
bool SparseConnection::write_to_file | ( | ForwardMatrix * | m, |
std::string | filename | ||
) |
Writes rank specific weight matrix on the same rank to a file.
This function writes all synaptic weights from the specified weight matrix which are stored on the same rank to a Matrix Market file in real coordinate format. The file can later be read with load_from_file to continue a simulation or can be processed offline using standard tools such as MATLAB or Python.
|
virtual |
Writes rank specific default weight matrix on the same rank to a file.
This call is a shortcut for write_to_file(w, filename) where w is the default weight matrix of the underlying SparseConnectoin.
Implements auryn::Connection.
Reimplemented in auryn::RateModulatedConnection.
NeuronID auryn::SparseConnection::patterns_every_post |
The every_post parameter allows to skip postsynaptically over pattern IDs when loading patterns. Default is 1. This can be useful to when loading patterns into the exc->inh connections and there significantly less inhibitory cells than exc ones.
NeuronID auryn::SparseConnection::patterns_every_pre |
The every_pre parameter allows to skip presynaptically over pattern IDs when loading patterns. Default is 1. This can be useful to when loading patterns into the exc->inh connections and there significantly less inhibitory cells than exc ones.
bool auryn::SparseConnection::patterns_ignore_gamma |
Switch that toggles for the load_patterns function whether or not to use the intensity (gamma) value. Default is false.
|
protected |
Switch that specifies whether or not to skip diagonal elemens during random connect. This is usefull for random connects to exclude autapses from the connections.
|
staticprotected |
/brief Static random number generator used for random connect
ForwardMatrix* auryn::SparseConnection::w |
A pointer that points per default to the ComplexMatrix that stores the connectinos.
|
protected |
/brief Maximum allowed weight value
This property is stored for Connection objects with plasticity. The value can be set and accessed with the setters get_max_weight() and set_max_weight(x)
|
protected |
/brief Minimum allowed weight value
This property is stored for Connection objects with plasticity. The value can be set and accessed with the setters get_min_weight() and set_min_weight(x)
bool auryn::SparseConnection::wrap_patterns |
Switch that toggles the behavior when loading a pattern to wrap neuron IDs back onto existing cells via the modulo function.