Auryn simulator
v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
|
The abstract base class for all Connection objects in Auryn. More...
#include <Connection.h>
Public Member Functions | |
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 AurynWeight | get (NeuronID i, NeuronID j)=0 |
Get weight value i,j if it exists. Otherwise the value is undefined. More... | |
virtual AurynWeight * | get_ptr (NeuronID i, NeuronID j)=0 |
Return pointer to weight element i,j if it exists, otherwise return NULL. More... | |
virtual AurynWeight | get_data (NeuronID i)=0 |
Return weight element as index in data array. More... | |
virtual void | set (NeuronID i, NeuronID j, AurynWeight value)=0 |
Set existing weight element i,j with value. More... | |
virtual AurynLong | get_nonzero ()=0 |
Return number of nonzero elements in this Connection. More... | |
virtual void | finalize ()=0 |
Finalize Connection after initialization to prepare for use in simulation. More... | |
virtual void | propagate ()=0 |
Propagate method to propagate spikes. Called by System run method. 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... | |
virtual void | stats (AurynDouble &mean, AurynDouble &std, StateID zid=0)=0 |
Computes mean synaptic weight and std dev of all weights in this connection. More... | |
virtual bool | write_to_file (std::string filename)=0 |
Implements save to file functionality. Also called in save_network_state from System class. More... | |
virtual bool | load_from_file (std::string filename)=0 |
Implements load from file functionality. Also called in save_network_state from System class. 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 | |
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 | |
virtual void | virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version) |
virtual void | virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version) |
void | init (TransmitterType transmitter=GLUT) |
Protected Attributes | |
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... | |
Friends | |
class | boost::serialization::access |
The abstract base class for all Connection objects in Auryn.
Connections are designed to take up spikes from a source a group that can spike in general (decendants of SpikingGroup) and to convey them to a group that can integrate spikes such as the children of NeuronGroup.
For that reason, when constructing any decendant of Connection you generally will have to specify a source (SpikingGroup) and a destination (NeuronGroup).
Connection::Connection | ( | ) |
Connection::Connection | ( | SpikingGroup * | source, |
NeuronGroup * | destination, | ||
TransmitterType | transmitter = GLUT , |
||
std::string | name = "Connection" |
||
) |
void Connection::add_number_of_spike_attributes | ( | int | x | ) |
Set up spike delay to accomodate x additional spike attributes.
Spike attribute numbers can only be increased. This function can only be run during initialization.
void Connection::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.
|
virtual |
Evolve method to update internal connection state. Called by System run method.
Reimplemented in auryn::TripletConnection, auryn::LPTripletConnection, auryn::MinimalTripletConnection, auryn::STPConnection, auryn::TripletScalingConnection, auryn::STDPwdConnection, auryn::RateModulatedConnection, and auryn::STDPConnection.
|
pure virtual |
Finalize Connection after initialization to prepare for use in simulation.
Implemented in auryn::SparseConnection, auryn::TripletConnection, auryn::LPTripletConnection, auryn::MinimalTripletConnection, auryn::STDPwdConnection, auryn::TripletScalingConnection, auryn::STDPConnection, auryn::FanOutConnection, auryn::AllToAllConnection, auryn::DuplexConnection, and auryn::IdentityConnection.
|
pure virtual |
Get weight value i,j if it exists. Otherwise the value is undefined.
Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
|
pure virtual |
Return weight element as index in data array.
Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
NeuronGroup * Connection::get_destination | ( | ) |
Returns pointer to the postsynaptic group.
std::string Connection::get_file_name | ( | ) |
Extracts the class name of the connection from the file name.
std::string Connection::get_log_name | ( | ) |
Returns a string which is the combination of file and connection name for logging.
NeuronID Connection::get_m_rows | ( | ) |
NeuronID Connection::get_n_cols | ( | ) |
std::string Connection::get_name | ( | ) |
|
pure virtual |
Return number of nonzero elements in this Connection.
Implemented in auryn::SparseConnection, auryn::IdentityConnection, auryn::FanOutConnection, and auryn::AllToAllConnection.
SpikeContainer * Connection::get_post_spikes | ( | ) |
Returns pointer to SpikeContainer for postsynaptic spikes on this node.
This corresponds to calling get_spikes_immediate() from the SpikingGroup. These spikes have been generated postsynaptically in the same timestep and have not been delayed yet. Equivalent to calling dst->get_spikes_immediate().
Trace * Connection::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.
Trace * Connection::get_post_trace | ( | const AurynDouble | tau | ) |
Returns a pointer to a postsynaptic trace object.
SpikeContainer * Connection::get_pre_spikes | ( | ) |
Supplies pointer to SpikeContainer of all presynaptic spikes.
This includes spikes from this group from all other nodes. This also means that these spikes have gone through the axonal dealy. Equivalent to calling src->get_spikes().
Trace * Connection::get_pre_trace | ( | const AurynDouble | tau | ) |
Returns a pointer to a presynaptic trace object.
|
pure virtual |
Return pointer to weight element i,j if it exists, otherwise return NULL.
Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
SpikingGroup * Connection::get_source | ( | ) |
Returns pointer to the presynaptic group.
AurynFloat Connection::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.
AurynStateVector * Connection::get_target_vector | ( | ) |
Returns target state vector if one is defined.
TransmitterType Connection::get_transmitter | ( | ) |
Returns transmitter type.
This is one of Auryn default transmitter types. It essentially characterizes an array of a state vector to which this Connections weight will be added upon synaptic transmission.
|
protected |
|
pure virtual |
Implements load from file functionality. Also called in save_network_state from System class.
Implemented in auryn::SparseConnection, auryn::RateModulatedConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
|
pure virtual |
Propagate method to propagate spikes. Called by System run method.
Implemented in auryn::SparseConnection, auryn::TripletConnection, auryn::LPTripletConnection, auryn::MinimalTripletConnection, auryn::STPConnection, auryn::TripletScalingConnection, auryn::STDPwdConnection, auryn::RateModulatedConnection, auryn::PairInteractionConnection, auryn::SymmetricSTDPConnection, auryn::DelayConnection, auryn::STDPConnection, auryn::FanOutConnection, auryn::AllToAllConnection, auryn::ABSConnection, auryn::IdentityConnection, and auryn::TripletDecayConnection.
void Connection::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).
|
pure virtual |
Set existing weight element i,j with value.
Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
void Connection::set_destination | ( | NeuronGroup * | source | ) |
Sets destination SpikingGroup of this connection.
void Connection::set_name | ( | std::string | name | ) |
void Connection::set_receptor | ( | AurynStateVector * | ptr | ) |
Same as set_target.
void Connection::set_receptor | ( | string | state_name | ) |
Sets target state of this connection directly the name of a state vector.
void Connection::set_source | ( | SpikingGroup * | source | ) |
Sets source SpikingGroup of this connection.
void Connection::set_target | ( | AurynWeight * | ptr | ) |
Sets target state of this connection directly via a pointer.
void Connection::set_target | ( | AurynStateVector * | ptr | ) |
Sets target state of this connection directly via a StateVector.
void Connection::set_target | ( | string | state_name | ) |
Same as set_receptor.
void auryn::Connection::set_transmitter | ( | AurynStateVector * | ptr | ) |
Same as set_target.
void Connection::set_transmitter | ( | TransmitterType | transmitter | ) |
Sets target state of this connection for a given receptor as one of Auryn's default transmitter types.
The most common transmitter types are GLUT and GABA. The postsynaptic NeuronGroup needs to make use of the g_ampa or g_gaba state vectors (AurynStateVector) for this to work.
void Connection::set_transmitter | ( | string | state_name | ) |
Same as set_receptor, but DEPRECATED.
|
pure virtual |
Computes mean synaptic weight and std dev of all weights in this connection.
Implemented in auryn::SparseConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
|
inline |
Transmits a spike to a given target group and state.
The method exposes the transmit interface and should not be used unless you know exactly what you are doing.
|
inline |
Default way to transmit a spike to a postsynaptic partner.
The method adds a given amount to the respective element in the target/transmitter array of the postsynaptic neuron specifeid by id. This is a new approach which replaces tadd to old method, increments transmitter specific state variables in neuron id. It turned out much faster that way, because the transmit function is one of the most often called function in the simulation and it can be efficiently inlined by the compiler.
|
inlineprotectedvirtual |
Serialization function for saving the Connection state. Implement in derived classes to save additional information.
Reimplemented in auryn::SparseConnection, and auryn::DelayConnection.
|
inlineprotectedvirtual |
Serialization function for loading the Connection state. Implement in derived classes to save additional information.
Reimplemented in auryn::SparseConnection, and auryn::DelayConnection.
|
pure virtual |
Implements save to file functionality. Also called in save_network_state from System class.
Implemented in auryn::SparseConnection, auryn::RateModulatedConnection, auryn::FanOutConnection, auryn::AllToAllConnection, and auryn::IdentityConnection.
|
friend |
NeuronGroup* auryn::Connection::dst |
Pointer to the destination group of this connection.
|
protected |
Number of spike attributes to expect with each spike transmitted through this connection.
Should only be set through methods called during init.
|
protected |
Stores spike attribute offset in attribute array.
SpikingGroup* auryn::Connection::src |
Pointer to the source group of this connection.
|
protected |
A more direct reference on the first element of the target_state_vector.
The logic of connection is that when the simulation starts *target points to the first element of an array with AurynWeight type which has the post_size of the target group. Each presynaptic spike will then trigger addition the values stored as weights in some weight matrix to that group.
|
protected |
|
protected |