Class implementing a synapse model for e-prop plasticity with additional biological features. More...
#include <eprop_synapse.h>
Classes | |
| class | ConnTestDummyNode |
| Dummy node for testing the connection. More... | |
Public Types | |
| typedef EpropSynapseCommonProperties | CommonPropertiesType |
| Type of the common synapse properties. | |
| typedef Connection< targetidentifierT > | ConnectionBase |
| Type of the connection base. | |
Public Member Functions | |
| eprop_synapse () | |
| Default constructor. | |
| ~eprop_synapse () | |
| Destructor. | |
| eprop_synapse (const eprop_synapse &) | |
| Parameterized copy constructor. | |
| eprop_synapse & | operator= (const eprop_synapse &) |
| Assignment operator. | |
| eprop_synapse (eprop_synapse &&) | |
| Move constructor. | |
| eprop_synapse & | operator= (eprop_synapse &&) |
| 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 EpropSynapseCommonProperties &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 ConnectionModelProperties | properties |
| Properties of the connection model. | |
| static constexpr bool | supports_flush_event = true |
| Whether this connection type supports flush events. | |
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. | |
| long | t_spike_previous_ = 0 |
| The time step when the previous spike arrived. | |
| bool | previous_was_flush_event_ = false |
| Previous event was a flush event. | |
| long | t_previous_trigger_spike_ = 0 |
| The time step when the spike arrived that triggered the previous e-prop update. | |
| double | z_bar_ = 0.0 |
| Low-pass filtered spiking variable. | |
| double | e_bar_ = 0.0 |
| Low-pass filtered eligibility trace. | |
| double | e_bar_reg_ = 0.0 |
| Low-pass filtered eligibility trace for firing rate regularization. | |
| double | epsilon_ = 0.0 |
| Adaptive threshold component of the eligibility vector. | |
| double | z_previous_buffer_ = 0.0 |
| Value of spiking variable one time step before t_previous_spike_. | |
| double | gradient_ = 0.0 |
| Sum of gradients. | |
| long | remaining_steps_until_cutoff_ = 0 |
| Remaining computation steps. | |
| long | decay_steps_ = 0 |
| Decay steps for the eligibility trace. | |
| 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_ |
Class implementing a synapse model for e-prop plasticity with additional biological features.
Class implementing a synapse model for e-prop plasticity according to Bellec et al. (2020) with additional biological features described in Korcsak-Gorzo et al. (2025).
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 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.spreadsort() to only use move operations, it should be possible to create the individual optimizers in the copy constructor of eprop_synapse and to delete it in the destructor. The default_connection can then own an optimizer and default values could be set on it. | typedef EpropSynapseCommonProperties nest::eprop_synapse< targetidentifierT >::CommonPropertiesType |
Type of the common synapse properties.
| typedef Connection< targetidentifierT > nest::eprop_synapse< targetidentifierT >::ConnectionBase |
Type of the connection base.
| nest::eprop_synapse< targetidentifierT >::eprop_synapse | ( | ) |
Default constructor.
| nest::eprop_synapse< targetidentifierT >::~eprop_synapse | ( | ) |
Destructor.
| nest::eprop_synapse< targetidentifierT >::eprop_synapse | ( | const eprop_synapse< targetidentifierT > & | es | ) |
Parameterized copy constructor.
| nest::eprop_synapse< targetidentifierT >::eprop_synapse | ( | eprop_synapse< targetidentifierT > && | es | ) |
Move constructor.
|
inline |
Check if the target accepts the event and receptor type requested by the sender.
References nest::WeightOptimizerCommonProperties::get_optimizer(), nest::EpropSynapseCommonProperties::optimizer_cp_, and nest::Node::register_eprop_connection().
|
inline |
Delete optimizer.
|
inline |
Return the delay of the connection in ms.
|
inline |
Return the delay of the connection in steps.
|
inline |
| void nest::eprop_synapse< targetidentifierT >::get_status | ( | Dictionary & | d | ) | const |
Get parameter dictionary.
References nest::names::optimizer(), nest::names::size_of(), and nest::names::weight().
|
inline |
| eprop_synapse< targetidentifierT > & nest::eprop_synapse< targetidentifierT >::operator= | ( | const eprop_synapse< targetidentifierT > & | es | ) |
Assignment operator.
References nest::eprop_synapse< targetidentifierT >::decay_steps_, nest::eprop_synapse< targetidentifierT >::e_bar_, nest::eprop_synapse< targetidentifierT >::e_bar_reg_, nest::eprop_synapse< targetidentifierT >::epsilon_, nest::eprop_synapse< targetidentifierT >::gradient_, nest::eprop_synapse< targetidentifierT >::optimizer_, nest::eprop_synapse< targetidentifierT >::previous_was_flush_event_, nest::eprop_synapse< targetidentifierT >::remaining_steps_until_cutoff_, nest::eprop_synapse< targetidentifierT >::t_previous_trigger_spike_, nest::eprop_synapse< targetidentifierT >::t_spike_previous_, nest::eprop_synapse< targetidentifierT >::weight_, nest::eprop_synapse< targetidentifierT >::z_bar_, and nest::eprop_synapse< targetidentifierT >::z_previous_buffer_.
| eprop_synapse< targetidentifierT > & nest::eprop_synapse< targetidentifierT >::operator= | ( | eprop_synapse< targetidentifierT > && | es | ) |
Move assignment operator.
| bool nest::eprop_synapse< targetidentifierT >::send | ( | Event & | e, |
| size_t | thread, | ||
| const EpropSynapseCommonProperties & | cp | ||
| ) |
Send the spike event.
| void nest::eprop_synapse< targetidentifierT >::set_status | ( | const Dictionary & | d, |
| ConnectorModel & | cm | ||
| ) |
Update values in parameter dictionary.
References nest::names::optimizer(), and nest::names::weight().
|
inline |
Set the synaptic weight to the provided value.
References nest::eprop_synapse< targetidentifierT >::weight_.
|
private |
Decay steps for the eligibility trace.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Low-pass filtered eligibility trace.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Low-pass filtered eligibility trace for firing rate regularization.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Adaptive threshold component of the eligibility vector.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Sum of gradients.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Optimizer.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Previous event was a flush event.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
staticconstexpr |
Properties of the connection model.
|
private |
Remaining computation steps.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
staticconstexpr |
Whether this connection type supports flush events.
|
private |
The time step when the spike arrived that triggered the previous e-prop update.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
The time step when the previous spike arrived.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Synaptic weight.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=(), and nest::eprop_synapse< targetidentifierT >::set_weight().
|
private |
Low-pass filtered spiking variable.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().
|
private |
Value of spiking variable one time step before t_previous_spike_.
Referenced by nest::eprop_synapse< targetidentifierT >::operator=().