Cypress
1.0
C++ Spiking Neural Network Simulation Framework
|
#include <connector.hpp>
Public Member Functions | |
virtual | ~Connector ()=default |
virtual void | connect (const ConnectionDescriptor &descr, std::vector< LocalConnection > &tar) const =0 |
virtual bool | valid (const ConnectionDescriptor &descr) const =0 |
bool | allow_self_connections () const |
Real | additional_parameter () const |
virtual std::string | name () const =0 |
virtual size_t | size (size_t size_src_pop, size_t size_target_pop) const =0 |
const std::shared_ptr< SynapseBase > | synapse () const |
const std::string | synapse_name () const |
const std::vector< LocalConnection > & | learned_weights () const |
void | _store_learned_weights (std::vector< LocalConnection > &&weights) |
Static Public Member Functions | |
static std::unique_ptr< AllToAllConnector > | all_to_all (Real weight=1.0, Real delay=0.0, bool allow_self_connections=true) |
static std::unique_ptr< AllToAllConnector > | all_to_all (SynapseBase &synapse, bool allow_self_connections=true) |
static std::unique_ptr< OneToOneConnector > | one_to_one (Real weight=1.0, Real delay=0.0) |
static std::unique_ptr< OneToOneConnector > | one_to_one (SynapseBase &synapse) |
static std::unique_ptr< FromListConnector > | from_list (const std::vector< LocalConnection > &connections) |
static std::unique_ptr< FromListConnector > | from_list (std::initializer_list< LocalConnection > connections) |
static std::unique_ptr< FromListConnector > | from_list (const std::vector< LocalConnection > &connections, SynapseBase &synapse) |
static std::unique_ptr< FromListConnector > | from_list (std::initializer_list< LocalConnection > connections, SynapseBase &synapse) |
template<typename F > | |
static std::unique_ptr< FunctorConnector< F > > | functor (const F &cback) |
template<typename F > | |
static std::unique_ptr< UniformFunctorConnector< F > > | functor (const F &cback, Real weight, Real delay=0.0) |
static std::unique_ptr< FixedProbabilityConnector< std::default_random_engine > > | fixed_probability (std::unique_ptr< Connector > connector, Real p, bool allow_self_connections=true) |
static std::unique_ptr< FixedProbabilityConnector< std::default_random_engine > > | fixed_probability (std::unique_ptr< Connector > connector, Real p, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< RandomConnector< std::default_random_engine > > | random (Real weight=1, Real delay=0, Real probability=1, bool allow_self_connections=true) |
static std::unique_ptr< RandomConnector< std::default_random_engine > > | random (SynapseBase &synapse, Real probability=1, bool allow_self_connections=true) |
static std::unique_ptr< RandomConnector< std::default_random_engine > > | random (Real weight, Real delay, Real probability, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< RandomConnector< std::default_random_engine > > | random (SynapseBase &synapse, Real probability, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanInConnector< std::default_random_engine > > | fixed_fan_in (size_t n_fan_in, Real weight, Real delay=0.0, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanInConnector< std::default_random_engine > > | fixed_fan_in (size_t n_fan_in, SynapseBase &synapse, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanInConnector< std::default_random_engine > > | fixed_fan_in (size_t n_fan_in, Real weight, Real delay, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanInConnector< std::default_random_engine > > | fixed_fan_in (size_t n_fan_in, SynapseBase &synapse, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > | fixed_fan_out (size_t n_fan_out, Real weight, Real delay=0.0, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > | fixed_fan_out (size_t n_fan_out, SynapseBase &synapse, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > | fixed_fan_out (size_t n_fan_out, Real weight, Real delay, size_t seed, bool allow_self_connections=true) |
static std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > | fixed_fan_out (size_t n_fan_out, SynapseBase &synapse, size_t seed, bool allow_self_connections=true) |
Protected Member Functions | |
Connector (SynapseBase &synapse, bool self_connections) | |
Connector (std::shared_ptr< SynapseBase > synapse, bool self_connections) | |
Connector (Real weight, Real delay, bool self_connections) | |
Protected Attributes | |
std::shared_ptr< SynapseBase > | m_synapse |
std::vector< LocalConnection > | m_weights |
Real | m_additional_parameter = 0.0 |
bool | m_self_connections = true |
bool | m_seed_given = false |
The abstract Connector class defines the basic interface used to construct connections between populations of neurons. Implementations of this class implement these specific functions to provide such functionality as a one-to-one or an all-to-all connector.
This class furthermore provides some static methods which allow to quickly create any desired connector.
Implementors of this class must be careful to store all their data inside this class, as the actual "connect" method which creates the connections is deferred until the entire network is serialised.
|
inlineexplicitprotected |
Default constructor.
|
inlineexplicitprotected |
|
virtualdefault |
Virtual default destructor.
|
inline |
Used internally to store the learned weights
weights | matrix of new weights |
|
inline |
|
inlinestatic |
Creates an all-to-all connector and returns a pointer at the connector.
weight | is the synaptic weight that should be used for all connections. |
delay | is the synaptic delay that should be used for all connections. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
Inline methods
|
inlinestatic |
Creates an all-to-all connector and returns a pointer at the connector.
synapse | Synapse object containing model and parameters |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inline |
Flag which either allows (true) or forbids self connections if the source and target population are the same
|
pure virtual |
Tells the Connector to actually create the neuron-to-neuron connections between certain neurons.
descr | is the connection descriptor containing the data detailing the connection. |
tar | is the vector the connections should be appended to. |
Implemented in cypress::FixedFanOutConnector< RandomEngine >, cypress::FixedFanInConnector< RandomEngine >, cypress::FixedProbabilityConnector< RandomEngine >, cypress::UniformFunctorConnector< Callback >, cypress::FunctorConnector< Callback >, cypress::FromListConnector, cypress::OneToOneConnector, and cypress::AllToAllConnector.
|
inlinestatic |
Connector which randomly selects neurons from the source population and ensures a fixed fan in (number of incomming connections) in each of the target neurons.
n_fan_in | is the fan in that should be ensured. |
weight | is the connection weight. |
delay | is the synaptic delay. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the source population and ensures a fixed fan in (number of incomming connections) in each of the target neurons.
n_fan_in | is the fan in that should be ensured. |
synapse | Synapse object containing model and parameters |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the source population and ensures a fixed fan in (number of incomming connections) in each of the target neurons. Uses the given seed for the initialization of the random engine.
n_fan_in | is the fan in that should be ensured. |
weight | is the connection weight. |
delay | is the synaptic delay. |
seed | is the seed that should be used in order to initialize the random engine. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the source population and ensures a fixed fan in (number of incomming connections) in each of the target neurons. Uses the given seed for the initialization of the random engine.
n_fan_in | is the fan in that should be ensured. |
synapse | Synapse object containing model and parameters |
seed | is the seed that should be used in order to initialize the random engine. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the target population and ensures a fixed fan out (number of outgoing connections) in each of the source neurons.
n_fan_out | is the fan out that should be ensured. |
weight | is the connection weight. |
delay | is the synaptic delay. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the target population and ensures a fixed fan out (number of outgoing connections) in each of the source neurons.
n_fan_out | is the fan out that should be ensured. |
synapse | Synapse object containing model and parameters |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the target population and ensures a fixed fan out (number of outgoing connections) in each of the source neurons. Uses the given seed for the initialization of the random engine.
n_fan_out | is the fan out that should be ensured. |
weight | is the connection weight. |
delay | is the synaptic delay. |
seed | is the seed that should be used in order to initialize the random engine. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector which randomly selects neurons from the target population and ensures a fixed fan out (number of outgoing connections) in each of the source neurons. Uses the given seed for the initialization of the random engine.
n_fan_out | is the fan out that should be ensured. |
synapse | Synapse object containing model and parameters |
seed | is the seed that should be used in order to initialize the random engine. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
connector | another connector that should be modified by this connector. |
p | probability with which an connection is created. |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
connector | another connector that should be modified by this connector. |
p | probability with which an connection is created. |
seed | is the seed the random number generator should be initialised with. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
connections | is a list of connections that should be created. |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
connections | is a list of connections that should be created. |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
connections | is a list of connections that should be created. |
synapse | prototype synapse for non-standard synapses |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
connections | is a list of connections that should be created. |
synapse | prototype synapse for non-standard synapses |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
cback | is a function which is called for each neuron-pair in the two populations and which is supposed to return a synapse description. If the returned synapse is invalid, no connection is created. |
|
inlinestatic |
Create a list connector which creates connections according to the given list.
cback | is a function which is called for each neuron-pair in the two populations and which is supposed to return a synapse description. If the returned synapse is invalid, no connection is created. |
weight | is the synaptic weight that should be used for all connections. |
delay | is the synaptic delay that should be used for all connections. |
|
inline |
Returns a vector of (source, target, weight, delay) for learning synapses The returned structure can be used for a new FromListConnector...
|
pure virtual |
Function which should return a name identifying the connector type – this name can be used for printing error messages or for visualisation purposes.
Implemented in cypress::FixedFanOutConnector< RandomEngine >, cypress::FixedFanInConnector< RandomEngine >, cypress::RandomConnector< RandomEngine >, cypress::FixedProbabilityConnectorBase, cypress::UniformFunctorConnectorBase, cypress::FunctorConnectorBase, cypress::FromListConnector, cypress::OneToOneConnector, and cypress::AllToAllConnector.
|
inlinestatic |
Create a a one-to-one connector and returns a pointer at the connector.
weight | is the synaptic weight that should be used for all connections. |
delay | is the synaptic delay that should be used for all connections. |
|
inlinestatic |
Creates an one-to-one connector and returns a pointer at the connector.
synapse | Synapse object containing model and parameters |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
weight | is the synaptic weight that should be used for all connections. |
delay | is the synaptic delay that should be used for all connections. |
probability | probability with which an connection is created. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
synapse | Synapse object containing model and parameters |
probability | probability with which an connection is created. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
weight | is the synaptic weight that should be used for all connections. |
delay | is the synaptic delay that should be used for all connections. |
probability | probability with which an connection is created. |
seed | is the seed the random number generator should be initialised with. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
inlinestatic |
Connector adapter which ensures connections are only produced with a certain probability.
synapse | Synapse object containing model and parameters |
probability | probability with which an connection is created. |
seed | is the seed the random number generator should be initialised with. |
allow_self_connections | Flag which either allows (true) or forbids self connections if the source and target population are the same |
|
pure virtual |
Returns the number of connections created with this connector and given pop sizes
size_src_pop | Size of source population |
size_target_pop | Size of target population |
Implemented in cypress::FixedFanOutConnector< RandomEngine >, cypress::FixedFanInConnector< RandomEngine >, cypress::FixedProbabilityConnector< RandomEngine >, cypress::UniformFunctorConnectorBase, cypress::FunctorConnector< Callback >, cypress::FromListConnector, cypress::OneToOneConnector, and cypress::AllToAllConnector.
|
inline |
Returns a pointer to the underlying synapse object used in the connector
|
inline |
Directly access the name of the synapse model
|
pure virtual |
Returns true if the connector can create the connections for the given connection descriptor. While most connectors will always be able to create a connection, for example a one-to-one connector
Implemented in cypress::FixedFanOutConnector< RandomEngine >, cypress::FixedFanInConnector< RandomEngine >, cypress::FixedProbabilityConnector< RandomEngine >, cypress::UniformFunctorConnector< Callback >, cypress::FunctorConnector< Callback >, cypress::FromListConnector, cypress::OneToOneConnector, and cypress::AllToAllConnector.
|
protected |
A additional parameter a connector might use (e.g. probability)
|
protected |
If a random connector is created with seed, we need this flag to not use the high level connectors of a backend, but generating connections here and using a list-connector
|
protected |
Flag for allowing neuron self connections if source and target population are identical
|
protected |
Synapse model
|
protected |
This where learned weights are stored (e.g. using STDP)