23#ifndef EPROP_READOUT_BSSHSLM_2020_H
24#define EPROP_READOUT_BSSHSLM_2020_H
287 void update(
Time const&,
const long,
const long )
override;
290 const long t_previous_update,
291 const long t_previous_trigger_spike,
293 const bool average_gradient )
override;
500 if ( receptor_type != 0 )
511 if ( receptor_type != 0 )
523 size_t model_id = e.get_sender().get_model_id();
525 if ( step_rate_model_id == model_id and receptor_type !=
TARGET_SIG )
528 "eprop_readout_bsshslm_2020 neurons expect a connection with a step_rate_generator node through receptor_type "
537 return receptor_type;
543 if ( receptor_type != 0 )
575 const double delta_EL = ptmp.
set( d,
this );
576 stmp.
set( d, ptmp, delta_EL,
this );
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Event for electrical currents.
Definition event.h:569
Request data to be logged/logged data to be sent.
Definition event.h:636
Event for rate model connections with delay.
Definition secondary_event.h:331
Class implementing an intermediate archiving node model for readout node models supporting e-prop pla...
Definition eprop_archiving_node_readout.h:43
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition eprop_archiving_node_readout.h:87
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition eprop_archiving_node_readout.h:97
const long delay_rec_out_
Transmission delay from recurrent to output neurons.
Definition eprop_archiving_node.h:174
const long delay_in_rec_
Transmission delay from input to recurrent neurons.
Definition eprop_archiving_node.h:171
const long offset_gen_
Offset since generator signals start from time step 1.
Definition eprop_archiving_node.h:168
To be thrown if a connection is not possible.
Definition exceptions.h:490
Event for learning signal connections.
Definition secondary_event.h:384
size_t get_node_model_id(const std::string) const
Definition model_manager.cpp:310
Base class for all NEST network objects.
Definition node.h:99
std::string get_name() const
Return class name.
Definition node.cpp:105
Map names of recordables to data access functions.
Definition recordables_map.h:61
Buffer Layout.
Definition ring_buffer.h:83
Event for spike information.
Definition event.h:418
Definition nest_time.h:135
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
Class implementing a readout neuron model for e-prop plasticity.
Definition eprop_readout_bsshslm_2020.h:246
eprop_readout_bsshslm_2020()
Default constructor.
Definition eprop_readout_bsshslm_2020.cpp:172
double get_readout_signal_() const
Get the current value of the normalized readout signal.
Definition eprop_readout_bsshslm_2020.h:441
Variables_ V_
Structure of internal variables.
Definition eprop_readout_bsshslm_2020.h:476
void compute_error_signal_mean_squared_error()
Compute the error signal based on the mean-squared error loss.
Definition eprop_readout_bsshslm_2020.cpp:310
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition eprop_readout_bsshslm_2020.h:498
double get_readout_signal_unnorm_() const
Get the current value of the unnormalized readout signal.
Definition eprop_readout_bsshslm_2020.h:448
bool is_eprop_recurrent_node() const override
Checks if the node is part of the recurrent network and thus not a readout neuron.
Definition eprop_readout_bsshslm_2020.h:492
void compute_error_signal_cross_entropy()
Compute the error signal based on the cross-entropy loss.
Definition eprop_readout_bsshslm_2020.cpp:318
RateSynapseTypes
Enumeration of spike receptor types.
Definition eprop_readout_bsshslm_2020.h:426
@ SUP_RATE_RECEPTOR
Definition eprop_readout_bsshslm_2020.h:429
@ READOUT_SIG
Definition eprop_readout_bsshslm_2020.h:427
@ TARGET_SIG
Definition eprop_readout_bsshslm_2020.h:428
void sends_secondary_event(DelayedRateConnectionEvent &) override
Required to check, if source neuron may send a SecondaryEvent.
Definition eprop_readout_bsshslm_2020.h:266
void(eprop_readout_bsshslm_2020::* compute_error_signal)()
Compute the error signal based on a loss function.
Definition eprop_readout_bsshslm_2020.h:305
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition eprop_readout_bsshslm_2020.cpp:353
void sends_secondary_event(LearningSignalConnectionEvent &) override
Required to check if source node may send a LearningSignalConnectionEvent.
Definition eprop_readout_bsshslm_2020.h:261
static RecordablesMap< eprop_readout_bsshslm_2020 > recordablesMap_
Map storing a static set of recordables.
Definition eprop_readout_bsshslm_2020.h:482
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) override
Compute gradient change for eprop synapses.
Definition eprop_readout_bsshslm_2020.cpp:377
Parameters_ P_
Structure of parameters.
Definition eprop_readout_bsshslm_2020.h:470
double get_target_signal_() const
Get the current value of the target signal.
Definition eprop_readout_bsshslm_2020.h:455
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition eprop_readout_bsshslm_2020.cpp:203
State_ S_
Structure of state variables.
Definition eprop_readout_bsshslm_2020.h:473
long get_shift() const override
Retrieves the temporal shift of the signal.
Definition eprop_readout_bsshslm_2020.h:486
void init_buffers_() override
Configure persistent internal data structures.
Definition eprop_readout_bsshslm_2020.cpp:194
friend class UniversalDataLogger< eprop_readout_bsshslm_2020 >
Logger for universal data supporting the data logging request / reply mechanism. Populated with a rec...
Definition eprop_readout_bsshslm_2020.h:311
static const size_t MIN_RATE_RECEPTOR
Minimal spike receptor type.
Definition eprop_readout_bsshslm_2020.h:422
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition eprop_readout_bsshslm_2020.h:567
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition eprop_readout_bsshslm_2020.h:552
double get_error_signal_() const
Get the current value of the error signal.
Definition eprop_readout_bsshslm_2020.h:462
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition eprop_readout_bsshslm_2020.cpp:230
double get_v_m_() const
Get the current value of the membrane voltage.
Definition eprop_readout_bsshslm_2020.h:434
Buffers_ B_
Structure of buffers.
Definition eprop_readout_bsshslm_2020.h:479
ModelManager model_manager
Definition kernel_manager.h:243
virtual size_t handles_test_event(SpikeEvent &, size_t receptor_type)
Check if the node can handle a particular event and receptor type.
Definition node.cpp:271
virtual void sends_secondary_event(GapJunctionEvent &ge)
Required to check, if source neuron may send a SecondaryEvent.
Definition node.cpp:381
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:265
const std::string recordables("recordables")
const std::string receptor_types("receptor_types")
const std::string readout_signal("readout_signal")
const std::string target_signal("target_signal")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_eprop_readout_bsshslm_2020(const std::string &name)
Definition eprop_readout_bsshslm_2020.cpp:43
KernelManager & kernel()
Definition kernel_manager.h:311
Structure of buffers.
Definition eprop_readout_bsshslm_2020.h:383
double normalization_rate_
Normalization rate of the readout signal. Sum of the readout signals of all readout neurons.
Definition eprop_readout_bsshslm_2020.h:391
UniversalDataLogger< eprop_readout_bsshslm_2020 > logger_
Logger for universal data.
Definition eprop_readout_bsshslm_2020.h:400
RingBuffer currents_
Buffer for incoming currents.
Definition eprop_readout_bsshslm_2020.h:397
RingBuffer spikes_
Buffer for incoming spikes.
Definition eprop_readout_bsshslm_2020.h:394
Structure of parameters.
Definition eprop_readout_bsshslm_2020.h:315
double I_e_
Constant external input current (pA).
Definition eprop_readout_bsshslm_2020.h:323
void get(Dictionary &) const
Get the parameters and their values.
Definition eprop_readout_bsshslm_2020.cpp:107
bool regular_spike_arrival_
If True, the input spikes arrive at the beginning of the time step, if False at the end (determines P...
Definition eprop_readout_bsshslm_2020.h:329
Parameters_()
Default constructor.
Definition eprop_readout_bsshslm_2020.cpp:70
std::string loss_
Loss function ["mean_squared_error", "cross_entropy"].
Definition eprop_readout_bsshslm_2020.h:326
double V_min_
Absolute lower bound of the membrane voltage relative to the leak membrane potential (mV).
Definition eprop_readout_bsshslm_2020.h:335
double tau_m_
Time constant of the membrane (ms).
Definition eprop_readout_bsshslm_2020.h:332
double E_L_
Leak / resting membrane potential (mV).
Definition eprop_readout_bsshslm_2020.h:320
double set(const Dictionary &, Node *)
Set the parameters and throw errors in case of invalid values.
Definition eprop_readout_bsshslm_2020.cpp:119
double C_m_
Capacitance of the membrane (pF).
Definition eprop_readout_bsshslm_2020.h:317
Structure of state variables.
Definition eprop_readout_bsshslm_2020.h:349
State_()
Default constructor.
Definition eprop_readout_bsshslm_2020.cpp:81
double error_signal_
Error signal. Deviation between the readout and the target signal.
Definition eprop_readout_bsshslm_2020.h:351
double v_m_
Membrane voltage relative to the leak membrane potential (mV).
Definition eprop_readout_bsshslm_2020.h:366
void get(Dictionary &, const Parameters_ &) const
Get the state variables and their values.
Definition eprop_readout_bsshslm_2020.cpp:153
double target_signal_
Target / teacher signal that the network is supposed to learn.
Definition eprop_readout_bsshslm_2020.h:360
double readout_signal_unnorm_
Unnormalized readout signal. Readout signal not yet divided by the readout signals of other readout n...
Definition eprop_readout_bsshslm_2020.h:357
double z_in_
Binary input spike state variable - 1.0 if the neuron has spiked in the previous time step and 0....
Definition eprop_readout_bsshslm_2020.h:369
double i_in_
Input current (pA).
Definition eprop_readout_bsshslm_2020.h:363
void set(const Dictionary &, const Parameters_ &, double, Node *)
Set the state variables.
Definition eprop_readout_bsshslm_2020.cpp:163
double readout_signal_
Readout signal. Leaky integrated spikes emitted by the recurrent network.
Definition eprop_readout_bsshslm_2020.h:354
Structure of internal variables.
Definition eprop_readout_bsshslm_2020.h:405
bool signal_to_other_readouts_
If the loss requires communication between the readout neurons and thus a buffer for the exchanged si...
Definition eprop_readout_bsshslm_2020.h:417
double P_i_in_
Propagator matrix entry for evolving the incoming currents.
Definition eprop_readout_bsshslm_2020.h:414
double P_v_m_
Propagator matrix entry for evolving the membrane voltage (mathematical symbol "kappa" in user docume...
Definition eprop_readout_bsshslm_2020.h:407
double P_z_in_
Propagator matrix entry for evolving the incoming spike state variables (mathematical symbol "zeta" i...
Definition eprop_readout_bsshslm_2020.h:411