NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::eprop_synapse_bsshslm_2020< targetidentifierT > Class Template Reference

Class implementing a synapse model for e-prop plasticity. More...

#include <eprop_synapse_bsshslm_2020.h>

Inheritance diagram for nest::eprop_synapse_bsshslm_2020< targetidentifierT >:
[legend]
Collaboration diagram for nest::eprop_synapse_bsshslm_2020< targetidentifierT >:
[legend]

Classes

class  ConnTestDummyNode
 Dummy node for testing the connection. More...
 

Public Types

typedef EpropSynapseBSSHSLM2020CommonProperties CommonPropertiesType
 Type of the common synapse properties.
 
typedef Connection< targetidentifierT > ConnectionBase
 Type of the connection base.
 

Public Member Functions

 eprop_synapse_bsshslm_2020 ()
 Default constructor.
 
 ~eprop_synapse_bsshslm_2020 ()
 Destructor.
 
 eprop_synapse_bsshslm_2020 (const eprop_synapse_bsshslm_2020 &)
 Parameterized copy constructor.
 
eprop_synapse_bsshslm_2020 & operator= (const eprop_synapse_bsshslm_2020 &)
 Assignment operator.
 
 eprop_synapse_bsshslm_2020 (eprop_synapse_bsshslm_2020 &&)
 Move constructor.
 
eprop_synapse_bsshslm_2020 & operator= (eprop_synapse_bsshslm_2020 &&)
 Move assignment operator.
 
void get_status (Dictionary &d) const
 Get parameter dictionary.
 
void set_status (const Dictionary &d, ConnectorModel &cm)
 Update values in parameter dictionary.
 
bool send (Event &e, size_t thread, const EpropSynapseBSSHSLM2020CommonProperties &cp)
 Send the spike event.
 
void check_connection (Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &cp)
 Check if the target accepts the event and receptor type requested by the sender.
 
void set_weight (const double w)
 Set the synaptic weight to the provided value.
 
void delete_optimizer ()
 Delete optimizer.
 
double get_delay () const
 Return the delay of the connection in ms.
 
long get_delay_steps () const
 Return the delay of the connection in steps.
 
size_t get_rport () const
 
Node * get_target (const size_t tid) const
 
- Public Member Functions inherited from nest::Connection< targetidentifierT >
 Connection ()
 
 Connection (const Connection< targetidentifierT > &rhs)=default
 
Connection & operator= (const Connection< targetidentifierT > &rhs)=default
 
std::unique_ptr< SecondaryEvent > get_secondary_event ()
 Get a pointer to an instance of a SecondaryEvent if this connection supports secondary events.
 
void get_status (Dictionary &d) const
 Get all properties of this connection and put them into a dictionary.
 
void set_status (const Dictionary &d, ConnectorModel &cm)
 Set properties of this connection from the values given in dictionary.
 
void check_synapse_params (const Dictionary &d) const
 Check syn_spec dictionary for parameters that are not allowed with the given connection.
 
void calibrate (const TimeConverter &)
 Calibrate the delay of this connection to the desired resolution.
 
double get_delay () const
 Return the delay of the connection in ms.
 
long get_delay_steps () const
 Return the delay of the connection in steps.
 
void set_delay (const double delay)
 Set the delay of the connection.
 
void set_delay_steps (const long delay)
 Set the delay of the connection in steps.
 
void set_syn_id (synindex syn_id)
 Set the synapse id of the connection.
 
synindex get_syn_id () const
 Get the synapse id of the connection.
 
long get_label () const
 
void trigger_update_weight (const size_t, const std::vector< spikecounter > &, const double, const CommonSynapseProperties &)
 Triggers an update of a synaptic weight.
 
Node * get_target (const size_t tid) const
 
size_t get_rport () const
 
void set_source_has_more_targets (const bool more_targets)
 Sets a flag in the connection to signal that the following connection has the same source.
 
bool source_has_more_targets () const
 Returns a flag denoting whether the connection has source subsequent targets.
 
void disable ()
 Disables the connection.
 
bool is_disabled () const
 Returns a flag denoting if the connection is disabled.
 

Static Public Attributes

static constexpr bool supports_flush_event = true
 Whether this connection type supports flush events.
 
static constexpr ConnectionModelProperties properties
 Properties of the connection model.
 
- Static Public Attributes inherited from nest::Connection< targetidentifierT >
static constexpr ConnectionModelProperties properties = ConnectionModelProperties::NONE
 
static constexpr bool supports_flush_event = false
 

Private Attributes

double weight_
 Synaptic weight.
 
double gradient_
 Gradient used for the weight update.
 
long t_spike_previous_
 The time step when the previous spike arrived.
 
bool previous_was_flush_event_
 Previous event was a flush event.
 
long t_previous_update_
 The time step when the previous e-prop update was.
 
long t_next_update_
 The time step when the next e-prop update will be.
 
long t_previous_trigger_spike_
 The time step when the spike arrived that triggered the previous e-prop update.
 
double tau_m_readout_
 Time constant for low-pass filtering the eligibility trace.
 
double kappa_
 Low-pass filter of the eligibility trace.
 
bool is_recurrent_to_recurrent_conn_
 If this connection is between two recurrent neurons.
 
std::vector< long > presyn_isis_
 Vector of presynaptic inter-spike-intervals.
 
WeightOptimizer * optimizer_
 Optimizer.
 

Additional Inherited Members

- Protected Member Functions inherited from nest::Connection< targetidentifierT >
void check_connection_ (Node &dummy_target, Node &source, Node &target, const size_t receptor_type)
 This function calls check_connection() on the sender to check if the receiver accepts the event type and receptor type requested by the sender.
 
- Protected Attributes inherited from nest::Connection< targetidentifierT >
targetidentifierT target_
 
SynIdDelay syn_id_delay_
 

Detailed Description

template<typename targetidentifierT>
class nest::eprop_synapse_bsshslm_2020< targetidentifierT >

Class implementing a synapse model for e-prop plasticity.

Class implementing a synapse model for e-prop plasticity according to Bellec et al. (2020).

Note
Several aspects of this synapse are in place to reproduce the Tensorflow implementation of Bellec et al. (2020).
Each synapse has a optimizer_ object managed through a WeightOptimizer*, pointing to an object of a specific weight optimizer type. This optimizer, drawing also on parameters in the WeightOptimizerCommonProperties accessible via the synapse models CommonProperties::optimizer_cp_ pointer, computes the weight update for the neuron. The actual optimizer type can be selected at runtime (before creating any synapses) by exchanging the optimizer_cp_ pointer. Individual optimizer objects are created by check_connection() when a synapse is actually created. It is important that the constructors of eprop_synapse_bsshslm_2020 do not create optimizer objects and that the destructor does not delete optimizer objects; this currently leads to bugs when using Boosts's spreadsort() due to use of the copy constructor where it should suffice to use the move constructor. Therefore, check_connection()creates the optimizer object when it is needed and specializations of Connector::~Connector() and Connector::disable_connection() delete it by calling delete_optimizer(). A disadvantage of this approach is that the default_connection in the connector model does not have an optimizer object, whence it is not possible to set default (initial) values for the per-synapse optimizer.
If we can find a way to modify our co-sorting of source and target tables in Boost's spreadsort() to only use move operations, it should be possible to create the individual optimizers in the copy constructor of eprop_synapse_bsshslm_2020 and to delete it in the destructor. The default_connection can then own an optimizer and default values could be set on it.

Member Typedef Documentation

◆ CommonPropertiesType

template<typename targetidentifierT >
typedef EpropSynapseBSSHSLM2020CommonProperties nest::eprop_synapse_bsshslm_2020< targetidentifierT >::CommonPropertiesType

Type of the common synapse properties.

◆ ConnectionBase

template<typename targetidentifierT >
typedef Connection< targetidentifierT > nest::eprop_synapse_bsshslm_2020< targetidentifierT >::ConnectionBase

Type of the connection base.

Constructor & Destructor Documentation

◆ eprop_synapse_bsshslm_2020() [1/3]

template<typename targetidentifierT >
nest::eprop_synapse_bsshslm_2020< targetidentifierT >::eprop_synapse_bsshslm_2020 ( )

Default constructor.

◆ ~eprop_synapse_bsshslm_2020()

template<typename targetidentifierT >
nest::eprop_synapse_bsshslm_2020< targetidentifierT >::~eprop_synapse_bsshslm_2020 ( )

Destructor.

◆ eprop_synapse_bsshslm_2020() [2/3]

template<typename targetidentifierT >
nest::eprop_synapse_bsshslm_2020< targetidentifierT >::eprop_synapse_bsshslm_2020 ( const eprop_synapse_bsshslm_2020< targetidentifierT > &  es)

Parameterized copy constructor.

◆ eprop_synapse_bsshslm_2020() [3/3]

template<typename targetidentifierT >
nest::eprop_synapse_bsshslm_2020< targetidentifierT >::eprop_synapse_bsshslm_2020 ( eprop_synapse_bsshslm_2020< targetidentifierT > &&  es)

Move constructor.

Member Function Documentation

◆ check_connection()

template<typename targetidentifierT >
void nest::eprop_synapse_bsshslm_2020< targetidentifierT >::check_connection ( Node &  s,
Node &  t,
size_t  receptor_type,
const CommonPropertiesType &  cp 
)
inline

Check if the target accepts the event and receptor type requested by the sender.

Note
This sets the optimizer_ member.

References nest::WeightOptimizerCommonProperties::get_optimizer(), nest::Node::initialize_update_history(), nest::EpropSynapseBSSHSLM2020CommonProperties::optimizer_cp_, and nest::Node::register_eprop_connection().

Here is the call graph for this function:

◆ delete_optimizer()

template<typename targetidentifierT >
void nest::eprop_synapse_bsshslm_2020< targetidentifierT >::delete_optimizer ( )
inline

Delete optimizer.

◆ get_delay()

template<typename targetidentifierT >
double nest::Connection< targetidentifierT >::get_delay ( ) const
inline

Return the delay of the connection in ms.

◆ get_delay_steps()

template<typename targetidentifierT >
long nest::Connection< targetidentifierT >::get_delay_steps ( ) const
inline

Return the delay of the connection in steps.

◆ get_rport()

template<typename targetidentifierT >
size_t nest::Connection< targetidentifierT >::get_rport ( ) const
inline

◆ get_status()

template<typename targetidentifierT >
void nest::eprop_synapse_bsshslm_2020< targetidentifierT >::get_status ( Dictionary &  d) const

Get parameter dictionary.

References nest::names::optimizer(), nest::names::size_of(), nest::names::tau_m_readout(), and nest::names::weight().

Here is the call graph for this function:

◆ get_target()

template<typename targetidentifierT >
Node * nest::Connection< targetidentifierT >::get_target ( const size_t  tid) const
inline

◆ operator=() [1/2]

◆ operator=() [2/2]

template<typename targetidentifierT >
eprop_synapse_bsshslm_2020< targetidentifierT > & nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator= ( eprop_synapse_bsshslm_2020< targetidentifierT > &&  es)

Move assignment operator.

◆ send()

template<typename targetidentifierT >
bool nest::eprop_synapse_bsshslm_2020< targetidentifierT >::send ( Event &  e,
size_t  thread,
const EpropSynapseBSSHSLM2020CommonProperties &  cp 
)

Send the spike event.

References nest::EpropSynapseBSSHSLM2020CommonProperties::average_gradient_, nest::SimulationManager::get_eprop_update_interval(), nest::Time::get_steps(), nest::kernel(), nest::EpropSynapseBSSHSLM2020CommonProperties::optimizer_cp_, and nest::KernelManager::simulation_manager.

Here is the call graph for this function:

◆ set_status()

template<typename targetidentifierT >
void nest::eprop_synapse_bsshslm_2020< targetidentifierT >::set_status ( const Dictionary &  d,
ConnectorModel &  cm 
)

Update values in parameter dictionary.

References nest::Time::get_resolution(), nest::names::optimizer(), nest::names::tau_m_readout(), and nest::names::weight().

Here is the call graph for this function:

◆ set_weight()

template<typename targetidentifierT >
void nest::eprop_synapse_bsshslm_2020< targetidentifierT >::set_weight ( const double  w)
inline

Set the synaptic weight to the provided value.

References nest::eprop_synapse_bsshslm_2020< targetidentifierT >::weight_.

Member Data Documentation

◆ gradient_

template<typename targetidentifierT >
double nest::eprop_synapse_bsshslm_2020< targetidentifierT >::gradient_
private

Gradient used for the weight update.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ is_recurrent_to_recurrent_conn_

template<typename targetidentifierT >
bool nest::eprop_synapse_bsshslm_2020< targetidentifierT >::is_recurrent_to_recurrent_conn_
private

If this connection is between two recurrent neurons.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ kappa_

template<typename targetidentifierT >
double nest::eprop_synapse_bsshslm_2020< targetidentifierT >::kappa_
private

Low-pass filter of the eligibility trace.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ optimizer_

template<typename targetidentifierT >
WeightOptimizer* nest::eprop_synapse_bsshslm_2020< targetidentifierT >::optimizer_
private

Optimizer.

Note
Pointer is set by check_connection() and deleted by delete_optimizer().

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ presyn_isis_

template<typename targetidentifierT >
std::vector< long > nest::eprop_synapse_bsshslm_2020< targetidentifierT >::presyn_isis_
private

Vector of presynaptic inter-spike-intervals.

◆ previous_was_flush_event_

template<typename targetidentifierT >
bool nest::eprop_synapse_bsshslm_2020< targetidentifierT >::previous_was_flush_event_
private

Previous event was a flush event.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ properties

template<typename targetidentifierT >
constexpr ConnectionModelProperties nest::eprop_synapse_bsshslm_2020< targetidentifierT >::properties
staticconstexpr

◆ supports_flush_event

template<typename targetidentifierT >
constexpr bool nest::eprop_synapse_bsshslm_2020< targetidentifierT >::supports_flush_event = true
staticconstexpr

Whether this connection type supports flush events.

◆ t_next_update_

template<typename targetidentifierT >
long nest::eprop_synapse_bsshslm_2020< targetidentifierT >::t_next_update_
private

The time step when the next e-prop update will be.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ t_previous_trigger_spike_

template<typename targetidentifierT >
long nest::eprop_synapse_bsshslm_2020< targetidentifierT >::t_previous_trigger_spike_
private

The time step when the spike arrived that triggered the previous e-prop update.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ t_previous_update_

template<typename targetidentifierT >
long nest::eprop_synapse_bsshslm_2020< targetidentifierT >::t_previous_update_
private

The time step when the previous e-prop update was.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ t_spike_previous_

template<typename targetidentifierT >
long nest::eprop_synapse_bsshslm_2020< targetidentifierT >::t_spike_previous_
private

The time step when the previous spike arrived.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ tau_m_readout_

template<typename targetidentifierT >
double nest::eprop_synapse_bsshslm_2020< targetidentifierT >::tau_m_readout_
private

Time constant for low-pass filtering the eligibility trace.

Referenced by nest::eprop_synapse_bsshslm_2020< targetidentifierT >::operator=().

◆ weight_

template<typename targetidentifierT >
double nest::eprop_synapse_bsshslm_2020< targetidentifierT >::weight_
private

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