Cypress  1.0
C++ Spiking Neural Network Simulation Framework
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
cypress::UniformFunctorConnectorBase Class Referenceabstract

#include <connector.hpp>

Inheritance diagram for cypress::UniformFunctorConnectorBase:
Inheritance graph
[legend]
Collaboration diagram for cypress::UniformFunctorConnectorBase:
Collaboration graph
[legend]

Public Member Functions

std::string name () const override
 
size_t size (size_t size_src_pop, size_t size_target_pop) const override
 
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
 
const std::shared_ptr< SynapseBasesynapse () 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< AllToAllConnectorall_to_all (Real weight=1.0, Real delay=0.0, bool allow_self_connections=true)
 
static std::unique_ptr< AllToAllConnectorall_to_all (SynapseBase &synapse, bool allow_self_connections=true)
 
static std::unique_ptr< OneToOneConnectorone_to_one (Real weight=1.0, Real delay=0.0)
 
static std::unique_ptr< OneToOneConnectorone_to_one (SynapseBase &synapse)
 
static std::unique_ptr< FromListConnectorfrom_list (const std::vector< LocalConnection > &connections)
 
static std::unique_ptr< FromListConnectorfrom_list (std::initializer_list< LocalConnection > connections)
 
static std::unique_ptr< FromListConnectorfrom_list (const std::vector< LocalConnection > &connections, SynapseBase &synapse)
 
static std::unique_ptr< FromListConnectorfrom_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 Attributes

std::shared_ptr< SynapseBasem_synapse
 
std::vector< LocalConnectionm_weights
 
Real m_additional_parameter = 0.0
 
bool m_self_connections = true
 
bool m_seed_given = false
 

Member Function Documentation

void cypress::Connector::_store_learned_weights ( std::vector< LocalConnection > &&  weights)
inlineinherited

Used internally to store the learned weights

Parameters
weightsmatrix of new weights
Real cypress::Connector::additional_parameter ( ) const
inlineinherited
std::unique_ptr< AllToAllConnector > cypress::Connector::all_to_all ( Real  weight = 1.0,
Real  delay = 0.0,
bool  self_connections = true 
)
inlinestaticinherited

Creates an all-to-all connector and returns a pointer at the connector.

Parameters
weightis the synaptic weight that should be used for all connections.
delayis the synaptic delay that should be used for all connections.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector

Inline methods

std::unique_ptr< AllToAllConnector > cypress::Connector::all_to_all ( SynapseBase synapse,
bool  allow_self_connections = true 
)
inlinestaticinherited

Creates an all-to-all connector and returns a pointer at the connector.

Parameters
synapseSynapse object containing model and parameters
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
bool cypress::Connector::allow_self_connections ( ) const
inlineinherited

Flag which either allows (true) or forbids self connections if the source and target population are the same

virtual void cypress::Connector::connect ( const ConnectionDescriptor descr,
std::vector< LocalConnection > &  tar 
) const
pure virtualinherited

Tells the Connector to actually create the neuron-to-neuron connections between certain neurons.

Parameters
descris the connection descriptor containing the data detailing the connection.
taris 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.

std::unique_ptr< FixedFanInConnector< std::default_random_engine > > cypress::Connector::fixed_fan_in ( size_t  n_fan_in,
Real  weight,
Real  delay = 0.0,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_inis the fan in that should be ensured.
weightis the connection weight.
delayis the synaptic delay.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanInConnector< std::default_random_engine > > cypress::Connector::fixed_fan_in ( size_t  n_fan_in,
SynapseBase synapse,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_inis the fan in that should be ensured.
synapseSynapse object containing model and parameters
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanInConnector< std::default_random_engine > > cypress::Connector::fixed_fan_in ( size_t  n_fan_in,
Real  weight,
Real  delay,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_inis the fan in that should be ensured.
weightis the connection weight.
delayis the synaptic delay.
seedis the seed that should be used in order to initialize the random engine.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanInConnector< std::default_random_engine > > cypress::Connector::fixed_fan_in ( size_t  n_fan_in,
SynapseBase synapse,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_inis the fan in that should be ensured.
synapseSynapse object containing model and parameters
seedis the seed that should be used in order to initialize the random engine.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > cypress::Connector::fixed_fan_out ( size_t  n_fan_out,
Real  weight,
Real  delay = 0.0,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_outis the fan out that should be ensured.
weightis the connection weight.
delayis the synaptic delay.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > cypress::Connector::fixed_fan_out ( size_t  n_fan_out,
SynapseBase synapse,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_outis the fan out that should be ensured.
synapseSynapse object containing model and parameters
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > cypress::Connector::fixed_fan_out ( size_t  n_fan_out,
Real  weight,
Real  delay,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_outis the fan out that should be ensured.
weightis the connection weight.
delayis the synaptic delay.
seedis the seed that should be used in order to initialize the random engine.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedFanOutConnector< std::default_random_engine > > cypress::Connector::fixed_fan_out ( size_t  n_fan_out,
SynapseBase synapse,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

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.

Parameters
n_fan_outis the fan out that should be ensured.
synapseSynapse object containing model and parameters
seedis the seed that should be used in order to initialize the random engine.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FixedProbabilityConnector< std::default_random_engine > > cypress::Connector::fixed_probability ( std::unique_ptr< Connector connector,
Real  p,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
connectoranother connector that should be modified by this connector.
pprobability with which an connection is created.
Returns
Unique pointer to the connector
std::unique_ptr< FixedProbabilityConnector< std::default_random_engine > > cypress::Connector::fixed_probability ( std::unique_ptr< Connector connector,
Real  p,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
connectoranother connector that should be modified by this connector.
pprobability with which an connection is created.
seedis the seed the random number generator should be initialised with.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< FromListConnector > cypress::Connector::from_list ( const std::vector< LocalConnection > &  connections)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
connectionsis a list of connections that should be created.
Returns
Unique pointer to the connector
std::unique_ptr< FromListConnector > cypress::Connector::from_list ( std::initializer_list< LocalConnection connections)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
connectionsis a list of connections that should be created.
Returns
Unique pointer to the connector
std::unique_ptr< FromListConnector > cypress::Connector::from_list ( const std::vector< LocalConnection > &  connections,
SynapseBase synapse 
)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
connectionsis a list of connections that should be created.
synapseprototype synapse for non-standard synapses
Returns
Unique pointer to the connector
std::unique_ptr< FromListConnector > cypress::Connector::from_list ( std::initializer_list< LocalConnection connections,
SynapseBase synapse 
)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
connectionsis a list of connections that should be created.
synapseprototype synapse for non-standard synapses
Returns
Unique pointer to the connector
template<typename F >
std::unique_ptr< FunctorConnector< F > > cypress::Connector::functor ( const F &  cback)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
cbackis 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.
Returns
Unique pointer to the connector
template<typename F >
std::unique_ptr< UniformFunctorConnector< F > > cypress::Connector::functor ( const F &  cback,
Real  weight,
Real  delay = 0.0 
)
inlinestaticinherited

Create a list connector which creates connections according to the given list.

Parameters
cbackis 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.
weightis the synaptic weight that should be used for all connections.
delayis the synaptic delay that should be used for all connections.
Returns
Unique pointer to the connector
const std::vector<LocalConnection>& cypress::Connector::learned_weights ( ) const
inlineinherited

Returns a vector of (source, target, weight, delay) for learning synapses The returned structure can be used for a new FromListConnector...

std::string cypress::UniformFunctorConnectorBase::name ( ) const
inlineoverridevirtual

Function which should return a name identifying the connector type – this name can be used for printing error messages or for visualisation purposes.

Returns
a reference at a string describing the name of the descriptor type.

Implements cypress::Connector.

std::unique_ptr< OneToOneConnector > cypress::Connector::one_to_one ( Real  weight = 1.0,
Real  delay = 0.0 
)
inlinestaticinherited

Create a a one-to-one connector and returns a pointer at the connector.

Parameters
weightis the synaptic weight that should be used for all connections.
delayis the synaptic delay that should be used for all connections.
Returns
Unique pointer to the connector
std::unique_ptr< OneToOneConnector > cypress::Connector::one_to_one ( SynapseBase synapse)
inlinestaticinherited

Creates an one-to-one connector and returns a pointer at the connector.

Parameters
synapseSynapse object containing model and parameters
Returns
Unique pointer to the connector
std::unique_ptr< RandomConnector< std::default_random_engine > > cypress::Connector::random ( Real  weight = 1,
Real  delay = 0,
Real  probability = 1,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
weightis the synaptic weight that should be used for all connections.
delayis the synaptic delay that should be used for all connections.
probabilityprobability with which an connection is created.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< RandomConnector< std::default_random_engine > > cypress::Connector::random ( SynapseBase synapse,
Real  probability = 1,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
synapseSynapse object containing model and parameters
probabilityprobability with which an connection is created.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< RandomConnector< std::default_random_engine > > cypress::Connector::random ( Real  weight,
Real  delay,
Real  probability,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
weightis the synaptic weight that should be used for all connections.
delayis the synaptic delay that should be used for all connections.
probabilityprobability with which an connection is created.
seedis the seed the random number generator should be initialised with.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
std::unique_ptr< RandomConnector< std::default_random_engine > > cypress::Connector::random ( SynapseBase synapse,
Real  probability,
size_t  seed,
bool  allow_self_connections = true 
)
inlinestaticinherited

Connector adapter which ensures connections are only produced with a certain probability.

Parameters
synapseSynapse object containing model and parameters
probabilityprobability with which an connection is created.
seedis the seed the random number generator should be initialised with.
allow_self_connectionsFlag which either allows (true) or forbids self connections if the source and target population are the same
Returns
Unique pointer to the connector
size_t cypress::UniformFunctorConnectorBase::size ( size_t  size_src_pop,
size_t  size_target_pop 
) const
inlineoverridevirtual

Returns the number of connections created with this connector and given pop sizes

Parameters
size_src_popSize of source population
size_target_popSize of target population
Returns
number of connections

Implements cypress::Connector.

const std::shared_ptr<SynapseBase> cypress::Connector::synapse ( ) const
inlineinherited

Returns a pointer to the underlying synapse object used in the connector

Returns
Shared-pointer to synapse
const std::string cypress::Connector::synapse_name ( ) const
inlineinherited

Directly access the name of the synapse model

Returns
string containing the name
virtual bool cypress::Connector::valid ( const ConnectionDescriptor descr) const
pure virtualinherited

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.

Member Data Documentation

Real cypress::Connector::m_additional_parameter = 0.0
protectedinherited

A additional parameter a connector might use (e.g. probability)

bool cypress::Connector::m_seed_given = false
protectedinherited

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

bool cypress::Connector::m_self_connections = true
protectedinherited

Flag for allowing neuron self connections if source and target population are identical

std::shared_ptr<SynapseBase> cypress::Connector::m_synapse
protectedinherited

Synapse model

std::vector<LocalConnection> cypress::Connector::m_weights
protectedinherited

This where learned weights are stored (e.g. using STDP)


The documentation for this class was generated from the following file: