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

Class implementing an intermediate archiving node model for recurrent node models supporting e-prop plasticity. More...

#include <eprop_archiving_node_recurrent.h>

Inheritance diagram for nest::EpropArchivingNodeRecurrent< hist_shift_required >:
[legend]
Collaboration diagram for nest::EpropArchivingNodeRecurrent< hist_shift_required >:
[legend]

Public Types

typedef double(EpropArchivingNodeRecurrent::* surrogate_gradient_function) (double, double, double, double, double)
 Defines the pointer-to-member function type for the surrogate gradient function.
 

Public Member Functions

 EpropArchivingNodeRecurrent ()
 Constructs a new EpropArchivingNodeRecurrent object.
 
 EpropArchivingNodeRecurrent (const EpropArchivingNodeRecurrent &other)
 Constructs an EpropArchivingNodeRecurrent object by copying another EpropArchivingNodeRecurrent object.
 
surrogate_gradient_function find_surrogate_gradient (const std::string &surrogate_gradient_function_name)
 Validates and finds surrogate gradient function based on the specified name.
 
double compute_piecewise_linear_surrogate_gradient (const double r, const double v_m, const double v_th, const double height, const double width)
 Computes a piecewise-linear function as the surrogate gradient.
 
double compute_exponential_surrogate_gradient (const double r, const double v_m, const double v_th, const double height, const double width)
 Computes an exponential function as the surrogate gradient.
 
double compute_fast_sigmoid_derivative_surrogate_gradient (const double r, const double v_m, const double v_th, const double height, const double width)
 Computes the derivative of a fast-sigmoid surrogate function as the surrogate gradient.
 
double compute_arctan_derivative_surrogate_gradient (const double r, const double v_m, const double v_th, const double height, const double width)
 Computes the derivative of an arctan surrogate function as the surrogate gradient.
 
void append_new_eprop_history_entry (const long time_step)
 Creates an entry for the specified time step at the end of the eprop history.
 
void write_surrogate_gradient_to_history (const long time_step, const double surrogate_gradient)
 Writes the surrogate gradient to the eprop history entry at the specified time step.
 
void write_learning_signal_to_history (const long time_step, const double learning_signal)
 Writes the learning signal to the eprop history entry at the specifed time step.
 
void write_firing_rate_reg_to_history (const long t_current_update, const double f_target, const double c_reg)
 Calculates the firing rate regularization for the current update and writes it to a new entry in the firing rate regularization history.
 
void write_firing_rate_reg_to_history (const long time_step, const double z, const double f_target, const double kappa_reg, const double c_reg)
 Calculates the current firing rate regularization and writes it to the eprop history at the specified time step.
 
double get_firing_rate_reg_history (const long time_step)
 Retrieves the firing rate regularization at the specified time step from the firing rate regularization history.
 
double get_learning_signal_from_history (const long time_step)
 Retrieves the learning signal from the eprop history at the specified time step.
 
void erase_used_firing_rate_reg_history ()
 Erases the history of the used firing rate regularization history.
 
void count_spike ()
 Counts an emitted spike for the firing rate regularization.
 
void reset_spike_count ()
 Resets the spike count for the firing rate regularization.
 
void get_status (Dictionary &d) const override
 Export properties of the node by setting entries in the status dictionary.
 
void set_status (const Dictionary &d) override
 Change properties of the node according to the entries in the dictionary.
 
- Public Member Functions inherited from nest::EpropArchivingNode< HistEntryEpropRecurrent >
 EpropArchivingNode ()
 Constructs a new EpropArchivingNode object.
 
 EpropArchivingNode (const EpropArchivingNode &n)
 Constructs a new EpropArchivingNode object by copying another EpropArchivingNode object.
 
void register_eprop_connection () override
 Registers an eprop connection.
 
void initialize_update_history () override
 Initializes the update history.
 
void write_update_to_history (const long t_previous_update, const long t_current_update, const bool is_flush_event, const bool previous_was_flush_event) override
 Registers the current update in the update history and deregisters the previous update.
 
void require_eprop_history_entry (const typename std::vector< HistEntryEpropRecurrent >::iterator eprop_hist_it, const long time_step) const
 Requires that an e-prop history iterator points to the expected time step.
 
std::vector< HistEntryEpropUpdate >::iterator get_update_history (const long time_step)
 Retrieves the update history entry for a specific time step.
 
std::vector< HistEntryEpropRecurrent >::iterator get_eprop_history (const long time_step)
 Retrieves the eprop history entry for a specified time step.
 
void erase_used_eprop_history () override
 Erases the used eprop history for bsshslm_2020 models.
 
void erase_used_eprop_history (const long t_spike, const long t_spike_previous) override
 Erases the used eprop history.
 
double get_eprop_history_duration () const
 Retrieves eprop history size.
 
long get_eprop_isi_trace_cutoff () const
 Retrieves the eprop ISI trace cutoff.
 
- Public Member Functions inherited from nest::Node
 Node ()
 
 Node (Node const &)
 
virtual ~Node ()
 
virtual Node * clone () const
 This function creates a new object by calling the derived class' copy constructor and returning its pointer.
 
virtual bool has_proxies () const
 Returns true if the node has proxies on remote threads.
 
virtual bool supports_urbanczik_archiving () const
 Returns true if the node supports the Urbanczik-Senn plasticity rule.
 
virtual bool local_receiver () const
 Returns true if the node only receives events from nodes/devices on the same thread.
 
virtual bool one_node_per_process () const
 Returns true if the node exists only once per process, but does not have proxies on remote threads.
 
virtual bool is_off_grid () const
 Returns true if the node sends/receives off-grid events.
 
virtual bool is_proxy () const
 Returns true if the node is a proxy node.
 
std::string get_name () const
 Return class name.
 
virtual std::string get_element_type () const
 Return the element type of the node.
 
size_t get_node_id () const
 Return global Network ID.
 
int get_model_id () const
 Return model ID of the node.
 
bool is_frozen () const
 Returns true if node is frozen, i.e., shall not be updated.
 
bool node_uses_wfr () const
 Returns true if the node uses the waveform relaxation method.
 
void set_node_uses_wfr (const bool)
 Sets node_uses_wfr_ member variable (to be able to set it to "true" for any class derived from Node)
 
void init ()
 Initialize node prior to first simulation after node has been created.
 
virtual void pre_run_hook ()=0
 Re-calculate dependent parameters of the node.
 
virtual void calibrate_time (const TimeConverter &)
 Re-calculate time-based properties of the node.
 
virtual void post_run_cleanup ()
 Cleanup node after Run.
 
virtual void finalize ()
 Finalize node.
 
virtual void update (Time const &, const long, const long)=0
 Advance the state of the node in time through the given interval.
 
virtual bool wfr_update (Time const &, const long, const long)
 Advance the state of the node in time through the given interval (see Node::update() for more details).
 
virtual size_t send_test_event (Node &receiving_node, size_t receptor_type, synindex syn_id, bool dummy_target)
 Send an event to the receiving_node passed as an argument.
 
virtual size_t handles_test_event (SpikeEvent &, size_t receptor_type)
 Check if the node can handle a particular event and receptor type.
 
virtual size_t handles_test_event (WeightRecorderEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (RateEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DataLoggingRequest &, size_t receptor_type)
 
virtual size_t handles_test_event (CurrentEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (ConductanceEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DoubleDataEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DSSpikeEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DSCurrentEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (GapJunctionEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (InstantaneousRateConnectionEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DiffusionConnectionEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (DelayedRateConnectionEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (LearningSignalConnectionEvent &, size_t receptor_type)
 
virtual size_t handles_test_event (SICEvent &, size_t receptor_type)
 
virtual void sends_secondary_event (GapJunctionEvent &ge)
 Required to check, if source neuron may send a SecondaryEvent.
 
virtual void sends_secondary_event (InstantaneousRateConnectionEvent &re)
 Required to check, if source neuron may send a SecondaryEvent.
 
virtual void sends_secondary_event (DiffusionConnectionEvent &de)
 Required to check, if source neuron may send a SecondaryEvent.
 
virtual void sends_secondary_event (DelayedRateConnectionEvent &re)
 Required to check, if source neuron may send a SecondaryEvent.
 
virtual void sends_secondary_event (LearningSignalConnectionEvent &re)
 Required to check if source node may send a LearningSignalConnectionEvent.
 
virtual void sends_secondary_event (SICEvent &sic)
 Required to check if source node may send a SICEvent.
 
virtual void register_stdp_connection (double, double)
 Register a STDP connection.
 
virtual long get_shift () const
 Retrieves the temporal shift of the signal.
 
virtual bool is_eprop_recurrent_node () const
 Checks if the node is part of the recurrent network and thus not a readout neuron.
 
virtual void handle (SpikeEvent &e)
 Handle incoming spike events.
 
virtual void handle (WeightRecorderEvent &e)
 Handle incoming weight recording events.
 
virtual void handle (RateEvent &e)
 Handler for rate events.
 
virtual void handle (DataLoggingRequest &e)
 Handler for universal data logging request.
 
virtual void handle (DataLoggingReply &e)
 Handler for universal data logging request.
 
virtual void handle (CurrentEvent &e)
 Handler for current events.
 
virtual void handle (ConductanceEvent &e)
 Handler for conductance events.
 
virtual void handle (DoubleDataEvent &e)
 Handler for DoubleData events.
 
virtual void handle (GapJunctionEvent &e)
 Handler for gap junction events.
 
virtual void handle (InstantaneousRateConnectionEvent &e)
 Handler for rate neuron events.
 
virtual void handle (DiffusionConnectionEvent &e)
 Handler for rate neuron events.
 
virtual void handle (DelayedRateConnectionEvent &e)
 Handler for delay rate neuron events.
 
virtual void handle (LearningSignalConnectionEvent &e)
 Handler for learning signal connection events.
 
virtual void handle (SICEvent &e)
 Handler for slow inward current events (SICEvents).
 
virtual double get_Ca_minus () const
 Return the Ca_minus value at time Ca_t which corresponds to the time of the last update in Calcium concentration which is performed each time a Node spikes.
 
virtual double get_synaptic_elements (std::string) const
 Get the number of synaptic element for the current Node at Ca_t which corresponds to the time of the last spike.
 
virtual int get_synaptic_elements_vacant (std::string) const
 Get the number of vacant synaptic element for the current Node Return 0 if not overridden.
 
virtual int get_synaptic_elements_connected (std::string) const
 Get the number of connected synaptic element for the current Node.
 
virtual std::map< std::string, double > get_synaptic_elements () const
 Get the number of all synaptic elements for the current Node at time t.
 
virtual void update_synaptic_elements (double)
 Triggers the update of all SynapticElements stored in the synaptic_element_map_.
 
virtual void decay_synaptic_elements_vacant ()
 Is used to reduce the number of synaptic elements in the node through time.
 
virtual void connect_synaptic_element (std::string, int)
 Is used to update the number of connected synaptic elements (SynapticElement::z_connected_) when a synapse is formed or deleted.
 
virtual double get_K_value (double t)
 return the Kminus value at t (in ms).
 
virtual double get_LTD_value (double t)
 
virtual void get_K_values (double t, double &Kminus, double &nearest_neighbor_Kminus, double &Kminus_triplet)
 write the Kminus, nearest_neighbor_Kminus, and Kminus_triplet values at t (in ms) to the provided locations.
 
virtual void get_history (double t1, double t2, std::deque< histentry >::iterator *start, std::deque< histentry >::iterator *finish)
 return the spike history for (t1,t2].
 
virtual void get_LTP_history (double t1, double t2, std::deque< histentry_extended >::iterator *start, std::deque< histentry_extended >::iterator *finish)
 
virtual void get_urbanczik_history (double t1, double t2, std::deque< histentry_extended >::iterator *start, std::deque< histentry_extended >::iterator *finish, int)
 
virtual double get_C_m (int comp)
 
virtual double get_g_L (int comp)
 
virtual double get_tau_L (int comp)
 
virtual double get_tau_s (int comp)
 
virtual double get_tau_syn_ex (int comp)
 
virtual double get_tau_syn_in (int comp)
 
virtual void compute_gradient (const long t_spike, const long t_spike_previous, double &z_previous_buffer, double &z_bar, double &e_bar, double &e_bar_reg, double &epsilon, double &weight, const CommonSynapseProperties &cp, WeightOptimizer *optimizer, bool is_flush_event, bool previous_was_flush_event, double &sum_grad, long &remaining_steps_until_cutoff, long &decay_steps)
 Compute gradient change for eprop synapses.
 
virtual double compute_gradient (std::vector< long > &presyn_isis, const long t_previous_update, const long t_previous_trigger_spike, const double kappa, const bool average_gradient)
 Compute gradient change for eprop synapses.
 
virtual void event_hook (DSSpikeEvent &)
 Modify Event object parameters during event delivery.
 
virtual void event_hook (DSCurrentEvent &)
 
void set_thread (size_t)
 Store the number of the thread to which the node is assigned.
 
size_t get_thread () const
 Retrieve the number of the thread to which the node is assigned.
 
void set_vp (size_t)
 Store the number of the virtual process to which the node is assigned.
 
size_t get_vp () const
 Retrieve the number of the virtual process to which the node is assigned.
 
void set_model_id (int)
 Set the model id.
 
void set_initialized ()
 Execute post-initialization actions in node models.
 
virtual SignalType sends_signal () const
 
virtual SignalType receives_signal () const
 
Dictionary get_status_base ()
 Return a dictionary with the node's properties.
 
void set_status_base (const Dictionary &)
 Set status dictionary of a node.
 
bool is_model_prototype () const
 Returns true if node is model prototype.
 
void set_thread_lid (const size_t)
 set thread local index
 
size_t get_thread_lid () const
 get thread local index
 
virtual void set_local_device_id (const size_t lsdid)
 Sets the local device id.
 
virtual size_t get_local_device_id () const
 Gets the local device id.
 
void set_tmp_nc_index (size_t index)
 Set index in node collection; required by ThirdOutBuilder.
 
size_t get_tmp_nc_index ()
 Return and invalidate index in node collection; required by ThirdOutBuilder.
 
- Public Member Functions inherited from nest::FlushEventMechanism
 FlushEventMechanism ()
 Default constructor.
 
 FlushEventMechanism (const FlushEventMechanism &n)
 Copy constructor.
 
virtual ~FlushEventMechanism ()=default
 Destructor.
 
void set_last_event_time (const long last_event_time)
 Sets the time the neuron last sent an event (spike or flush event).
 
long get_last_event_time () const
 Gets the last time the neuron sent an event (spike or flush event).
 
void pre_run_hook ()
 Re-calculates dependent parameters.
 
bool flush_event_is_due (const long current_time) const
 Checks if a flush event is due at the current time.
 
void get_status (Dictionary &d) const
 Retrieves parameters and adds them to the status dictionary.
 
void set_status (const Dictionary &d, Node *node, const bool check_eprop_constraint=false)
 Sets and validates parameters from the status dictionary.
 
- Public Member Functions inherited from nest::IgnoreAndSpikeMechanism
 IgnoreAndSpikeMechanism ()
 Default constructor.
 
 IgnoreAndSpikeMechanism (const IgnoreAndSpikeMechanism &n)
 Copy constructor.
 
virtual ~IgnoreAndSpikeMechanism ()=default
 Virtual destructor.
 
bool spike_event_is_due (bool emit_dynamic_spike)
 Updates spike schedule and returns whether a spike should be emitted.
 
void get_status (Dictionary &d) const
 Retrieves parameters and adds them to the status dictionary.
 
void set_status (const Dictionary &d, Node *node)
 Sets and validates parameters from the status dictionary.
 

Public Attributes

double firing_rate_reg_
 Firing rate regularization.
 
double f_av_
 Average firing rate.
 
- Public Attributes inherited from nest::Node
DeprecationWarning deprecation_warning
 Member of DeprecationWarning class to be used by models if parameters are deprecated.
 

Protected Member Functions

long model_dependent_history_shift_ () const override
 Returns the correct shift for history depending on whether it is a normal or a bsshslm_2020 model.
 
- Protected Member Functions inherited from nest::Node
virtual void init_state_ ()
 Configure state variables depending on runtime information.
 
virtual void init_buffers_ ()
 Configure persistent internal data structures.
 
virtual void set_initialized_ ()
 
Model & get_model_ () const
 
void set_frozen_ (bool frozen)
 Mark node as frozen.
 
template<typename ConcreteNode >
const ConcreteNode & downcast (const Node &)
 Auxiliary function to downcast a Node to a concrete class derived from Node.
 

Protected Attributes

surrogate_gradient_function compute_surrogate_gradient_
 Pointer to member function selected for computing the surrogate gradient.
 
- Protected Attributes inherited from nest::EpropArchivingNode< HistEntryEpropRecurrent >
size_t eprop_indegree_
 Number of incoming eprop synapses.
 
double eprop_isi_trace_cutoff_
 Time interval from the previous spike until the cutoff of e-prop update computation between two spikes (ms).
 
std::vector< HistEntryEpropUpdate > update_history_
 History of updates still needed by at least one synapse.
 
std::vector< HistEntryEpropRecurrent > eprop_history_
 History of dynamic variables needed for e-prop plasticity.
 
const long offset_gen_
 Offset since generator signals start from time step 1.
 
const long delay_in_rec_
 Transmission delay from input to recurrent neurons.
 
const long delay_rec_out_
 Transmission delay from recurrent to output neurons.
 
const long delay_out_norm_
 Transmission delay between output neurons for normalization.
 
const long delay_out_rec_
 Transmission delay from output neurons to recurrent neurons.
 
- Protected Attributes inherited from nest::FlushEventMechanism
double flush_event_send_interval_
 Interval since previous event after which a flush event is sent (ms).
 
long flush_event_send_interval_steps_
 Interval since previous event after which a flush event is sent (steps).
 
long last_event_time_
 Time of last spike or flush event (steps).
 

Private Attributes

size_t n_spikes_
 Count of the emitted spikes for the firing rate regularization.
 
std::vector< HistEntryEpropFiringRateReg > firing_rate_reg_history_
 History of the firing rate regularization.
 

Static Private Attributes

static std::map< std::string, surrogate_gradient_function > surrogate_gradient_funcs_
 Maps provided names of surrogate gradients to corresponding pointers to member functions.
 

Detailed Description

template<bool hist_shift_required>
class nest::EpropArchivingNodeRecurrent< hist_shift_required >

Class implementing an intermediate archiving node model for recurrent node models supporting e-prop plasticity.

Member Typedef Documentation

◆ surrogate_gradient_function

template<bool hist_shift_required>
typedef double( EpropArchivingNodeRecurrent::* nest::EpropArchivingNodeRecurrent< hist_shift_required >::surrogate_gradient_function) (double, double, double, double, double)

Defines the pointer-to-member function type for the surrogate gradient function.

Note
The typename is surrogate_gradient_function. All parentheses in the expression are required.

Constructor & Destructor Documentation

◆ EpropArchivingNodeRecurrent() [1/2]

template<bool hist_shift_required>
nest::EpropArchivingNodeRecurrent< hist_shift_required >::EpropArchivingNodeRecurrent ( )

Constructs a new EpropArchivingNodeRecurrent object.

◆ EpropArchivingNodeRecurrent() [2/2]

template<bool hist_shift_required>
nest::EpropArchivingNodeRecurrent< hist_shift_required >::EpropArchivingNodeRecurrent ( const EpropArchivingNodeRecurrent< hist_shift_required > &  other)

Constructs an EpropArchivingNodeRecurrent object by copying another EpropArchivingNodeRecurrent object.

Parameters
otherThe EpropArchivingNodeRecurrent object to copy.

Member Function Documentation

◆ append_new_eprop_history_entry()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::append_new_eprop_history_entry ( const long  time_step)

Creates an entry for the specified time step at the end of the eprop history.

Parameters
time_stepThe time step.

◆ compute_arctan_derivative_surrogate_gradient()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::compute_arctan_derivative_surrogate_gradient ( const double  r,
const double  v_m,
const double  v_th,
const double  height,
const double  width 
)

Computes the derivative of an arctan surrogate function as the surrogate gradient.

This function returns a surrogate gradient of the hard threshold function around v_th. The derivative of an arctan surrogate function is used as surrogate gradient, for example, in Fang et al. (2021). This parametrization absorbs the pi factors from Fang et al. (2021) into the height and width parameters.

Parameters
rThe number of remaining refractory steps. If r > 0, the returned surrogate gradient is zero.
v_mThe membrane voltage.
v_thThe spike threshold voltage. For adaptive neurons, this is the adaptive spike threshold voltage.
heightThe positive height scaling of the surrogate gradient. This is the maximum value at v_m = v_th.
widthThe positive width scaling of the surrogate gradient. Larger width gives a wider gradient.
Returns
The surrogate gradient with respect to the membrane voltage.

◆ compute_exponential_surrogate_gradient()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::compute_exponential_surrogate_gradient ( const double  r,
const double  v_m,
const double  v_th,
const double  height,
const double  width 
)

Computes an exponential function as the surrogate gradient.

This function returns a surrogate gradient of the hard threshold function around v_th. The exponential surrogate gradient is used, for example, in Shrestha and Orchard (2018).

Parameters
rThe number of remaining refractory steps. If r > 0, the returned surrogate gradient is zero.
v_mThe membrane voltage.
v_thThe spike threshold voltage. For adaptive neurons, this is the adaptive spike threshold voltage.
heightThe positive height scaling of the surrogate gradient. This is the maximum value at v_m = v_th.
widthThe positive width scaling of the surrogate gradient. Larger width gives a wider gradient.
Returns
The surrogate gradient with respect to the membrane voltage.

◆ compute_fast_sigmoid_derivative_surrogate_gradient()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::compute_fast_sigmoid_derivative_surrogate_gradient ( const double  r,
const double  v_m,
const double  v_th,
const double  height,
const double  width 
)

Computes the derivative of a fast-sigmoid surrogate function as the surrogate gradient.

This function returns a surrogate gradient of the hard threshold function around v_th. The derivative of a fast-sigmoid function is used as surrogate gradient, for example, in Zenke and Ganguli (2018).

Parameters
rThe number of remaining refractory steps. If r > 0, the returned surrogate gradient is zero.
v_mThe membrane voltage.
v_thThe spike threshold voltage. For adaptive neurons, this is the adaptive spike threshold voltage.
heightThe positive height scaling of the surrogate gradient. This is the maximum value at v_m = v_th.
widthThe positive width scaling of the surrogate gradient. Larger width gives a wider gradient.
Returns
The surrogate gradient with respect to the membrane voltage.

◆ compute_piecewise_linear_surrogate_gradient()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::compute_piecewise_linear_surrogate_gradient ( const double  r,
const double  v_m,
const double  v_th,
const double  height,
const double  width 
)

Computes a piecewise-linear function as the surrogate gradient.

This function returns a surrogate gradient of the hard threshold function around v_th. The piecewise-linear surrogate gradient is used, for example, in Bellec et al. (2020).

Parameters
rThe number of remaining refractory steps. If r > 0, the returned surrogate gradient is zero.
v_mThe membrane voltage.
v_thThe spike threshold voltage. For adaptive neurons, this is the adaptive spike threshold voltage.
heightThe positive height scaling of the surrogate gradient. This is the maximum value at v_m = v_th.
widthThe positive width scaling of the surrogate gradient. Larger width gives a wider gradient.
Returns
The surrogate gradient with respect to the membrane voltage.

◆ count_spike()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::count_spike ( )
inline

Counts an emitted spike for the firing rate regularization.

◆ erase_used_firing_rate_reg_history()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::erase_used_firing_rate_reg_history ( )

Erases the history of the used firing rate regularization history.

Erases parts of the firing rate regularization history for which the access counter in the update history has decreased to zero since no synapse needs them any longer.

◆ find_surrogate_gradient()

template<bool hist_shift_required>
EpropArchivingNodeRecurrent< hist_shift_required >::surrogate_gradient_function nest::EpropArchivingNodeRecurrent< hist_shift_required >::find_surrogate_gradient ( const std::string &  surrogate_gradient_function_name)

Validates and finds surrogate gradient function based on the specified name.

Parameters
surrogate_gradient_function_nameThe name of the surrogate gradient function.
Returns
The selected surrogate gradient function.

Referenced by nest::eprop_iaf::Parameters_::set(), nest::eprop_iaf_adapt::Parameters_::set(), nest::eprop_iaf_adapt_bsshslm_2020::Parameters_::set(), nest::eprop_iaf_bsshslm_2020::Parameters_::set(), nest::eprop_iaf_psc_delta::Parameters_::set(), and nest::eprop_iaf_psc_delta_adapt::Parameters_::set().

Here is the caller graph for this function:

◆ get_firing_rate_reg_history()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::get_firing_rate_reg_history ( const long  time_step)

Retrieves the firing rate regularization at the specified time step from the firing rate regularization history.

Parameters
time_stepThe time step.
Returns
The firing rate regularization at the specified time step.

◆ get_learning_signal_from_history()

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::get_learning_signal_from_history ( const long  time_step)

Retrieves the learning signal from the eprop history at the specified time step.

Parameters
time_stepThe time step.
Returns
The learning signal at the specified time step or zero if time step is not in the history.

◆ get_status()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::get_status ( Dictionary &  ) const
inlineoverridevirtual

Export properties of the node by setting entries in the status dictionary.

Parameters
dDictionary.

Implements nest::Node.

References nest::names::eprop_isi_trace_cutoff(), nest::FlushEventMechanism::get_status(), and nest::IgnoreAndSpikeMechanism::get_status().

Referenced by nest::eprop_iaf::get_status(), nest::eprop_iaf_adapt::get_status(), nest::eprop_iaf_adapt_bsshslm_2020::get_status(), nest::eprop_iaf_bsshslm_2020::get_status(), nest::eprop_iaf_psc_delta::get_status(), and nest::eprop_iaf_psc_delta_adapt::get_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ model_dependent_history_shift_()

template<bool hist_shift_required>
long nest::EpropArchivingNodeRecurrent< hist_shift_required >::model_dependent_history_shift_ ( ) const
overrideprotectedvirtual

Returns the correct shift for history depending on whether it is a normal or a bsshslm_2020 model.

Returns
The history shift (steps).

Implements nest::EpropArchivingNode< HistEntryEpropRecurrent >.

◆ reset_spike_count()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::reset_spike_count ( )
inline

Resets the spike count for the firing rate regularization.

◆ set_status()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::set_status ( const Dictionary &  )
inlineoverridevirtual

Change properties of the node according to the entries in the dictionary.

Parameters
dDictionary with named parameter settings.

Implements nest::Node.

References nest::names::eprop_isi_trace_cutoff(), nest::IgnoreAndSpikeMechanism::set_status(), nest::FlushEventMechanism::set_status(), and nest::update_value_param().

Referenced by nest::eprop_iaf::set_status(), nest::eprop_iaf_adapt::set_status(), nest::eprop_iaf_adapt_bsshslm_2020::set_status(), nest::eprop_iaf_bsshslm_2020::set_status(), nest::eprop_iaf_psc_delta::set_status(), and nest::eprop_iaf_psc_delta_adapt::set_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_firing_rate_reg_to_history() [1/2]

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::write_firing_rate_reg_to_history ( const long  t_current_update,
const double  f_target,
const double  c_reg 
)

Calculates the firing rate regularization for the current update and writes it to a new entry in the firing rate regularization history.

Parameters
t_current_updateThe current update time.
f_targetThe target firing rate.
c_regThe firing rate regularization coefficient.

◆ write_firing_rate_reg_to_history() [2/2]

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::write_firing_rate_reg_to_history ( const long  time_step,
const double  z,
const double  f_target,
const double  kappa_reg,
const double  c_reg 
)

Calculates the current firing rate regularization and writes it to the eprop history at the specified time step.

Parameters
time_stepThe time step.
zThe spike state variable.
f_targetThe target firing rate.
kappa_regThe low-pass filter of the firing rate regularization.
c_regThe firing rate regularization coefficient.

◆ write_learning_signal_to_history()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::write_learning_signal_to_history ( const long  time_step,
const double  learning_signal 
)

Writes the learning signal to the eprop history entry at the specifed time step.

Updates the learning signal in the eprop history entry of the specified time step by writing the value of the incoming learning signal to the history or adding it to the existing value in case of multiple readout neurons.

Parameters
time_stepThe time step.
learning_signalThe learning signal.

◆ write_surrogate_gradient_to_history()

template<bool hist_shift_required>
void nest::EpropArchivingNodeRecurrent< hist_shift_required >::write_surrogate_gradient_to_history ( const long  time_step,
const double  surrogate_gradient 
)

Writes the surrogate gradient to the eprop history entry at the specified time step.

Parameters
time_stepThe time step.
surrogate_gradientThe surrogate gradient.

Member Data Documentation

◆ compute_surrogate_gradient_

template<bool hist_shift_required>
surrogate_gradient_function nest::EpropArchivingNodeRecurrent< hist_shift_required >::compute_surrogate_gradient_
protected
Initial value:
=
double compute_piecewise_linear_surrogate_gradient(const double r, const double v_m, const double v_th, const double height, const double width)
Computes a piecewise-linear function as the surrogate gradient.
Definition eprop_archiving_node_recurrent_impl.h:87

Pointer to member function selected for computing the surrogate gradient.

Referenced by nest::eprop_iaf::Parameters_::set(), nest::eprop_iaf_adapt::Parameters_::set(), nest::eprop_iaf_adapt_bsshslm_2020::Parameters_::set(), nest::eprop_iaf_bsshslm_2020::Parameters_::set(), nest::eprop_iaf_psc_delta::Parameters_::set(), and nest::eprop_iaf_psc_delta_adapt::Parameters_::set().

◆ f_av_

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::f_av_

Average firing rate.

◆ firing_rate_reg_

template<bool hist_shift_required>
double nest::EpropArchivingNodeRecurrent< hist_shift_required >::firing_rate_reg_

Firing rate regularization.

◆ firing_rate_reg_history_

template<bool hist_shift_required>
std::vector< HistEntryEpropFiringRateReg > nest::EpropArchivingNodeRecurrent< hist_shift_required >::firing_rate_reg_history_
private

History of the firing rate regularization.

◆ n_spikes_

template<bool hist_shift_required>
size_t nest::EpropArchivingNodeRecurrent< hist_shift_required >::n_spikes_
private

Count of the emitted spikes for the firing rate regularization.

◆ surrogate_gradient_funcs_

template<bool hist_shift_required>
std::map< std::string, typename EpropArchivingNodeRecurrent< hist_shift_required >::surrogate_gradient_function > nest::EpropArchivingNodeRecurrent< hist_shift_required >::surrogate_gradient_funcs_
staticprivate
Initial value:
= {
{ "piecewise_linear",
{ "fast_sigmoid_derivative",
{ "arctan_derivative",
}
Class implementing an intermediate archiving node model for recurrent node models supporting e-prop p...
Definition eprop_archiving_node_recurrent.h:43
double compute_arctan_derivative_surrogate_gradient(const double r, const double v_m, const double v_th, const double height, const double width)
Computes the derivative of an arctan surrogate function as the surrogate gradient.
Definition eprop_archiving_node_recurrent_impl.h:135

Maps provided names of surrogate gradients to corresponding pointers to member functions.

Todo:
In the long run, this map should be handled by a manager with proper registration functions, so that external modules can add their own gradient functions.

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