NEST main@caf0ae8
 
Loading...
Searching...
No Matches
eprop_archiving_node.h
Go to the documentation of this file.
1/*
2 * eprop_archiving_node.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef EPROP_ARCHIVING_NODE_H
24#define EPROP_ARCHIVING_NODE_H
25
26// nestkernel
28#include "histentry.h"
30#include "nest_time.h"
31#include "nest_types.h"
32#include "node.h"
33
34namespace nest
35{
51template < typename HistEntryT >
53{
54public:
59
66
67 void register_eprop_connection() override;
68 void initialize_update_history() override;
69
70 void write_update_to_history( const long t_previous_update,
71 const long t_current_update,
72 const bool is_flush_event,
73 const bool previous_was_flush_event ) override;
74
83 void require_eprop_history_entry( const typename std::vector< HistEntryT >::iterator eprop_hist_it,
84 const long time_step ) const;
85
92 std::vector< HistEntryEpropUpdate >::iterator get_update_history( const long time_step );
93
100 typename std::vector< HistEntryT >::iterator get_eprop_history( const long time_step );
101
108 void erase_used_eprop_history() override;
109
119 void erase_used_eprop_history( const long t_spike, const long t_spike_previous ) override;
120
128 double get_eprop_history_duration() const;
129
138 long
143
144protected:
150 virtual long model_dependent_history_shift_() const = 0;
151
154
157
159 std::vector< HistEntryEpropUpdate > update_history_;
160
162 std::vector< HistEntryT > eprop_history_;
163
164 // The following shifts are, for now, hardcoded to 1 time step since the current
165 // implementation only works if all the delays are equal to the simulation resolution.
166
168 const long offset_gen_ = 1;
169
171 const long delay_in_rec_ = 1;
172
174 const long delay_rec_out_ = 1;
175
177 const long delay_out_norm_ = 1;
178
180 const long delay_out_rec_ = 1;
181};
182
183} // namespace nest
184
185#endif // EPROP_ARCHIVING_NODE_H
Base class implementing archiving for node models supporting e-prop plasticity.
Definition eprop_archiving_node.h:53
std::vector< HistEntryT > eprop_history_
History of dynamic variables needed for e-prop plasticity.
Definition eprop_archiving_node.h:162
double eprop_isi_trace_cutoff_
Time interval from the previous spike until the cutoff of e-prop update computation between two spike...
Definition eprop_archiving_node.h:156
std::vector< HistEntryT >::iterator get_eprop_history(const long time_step)
Retrieves the eprop history entry for a specified time step.
Definition eprop_archiving_node_impl.h:157
EpropArchivingNode()
Constructs a new EpropArchivingNode object.
Definition eprop_archiving_node_impl.h:35
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.
Definition eprop_archiving_node_impl.h:81
std::vector< HistEntryEpropUpdate > update_history_
History of updates still needed by at least one synapse.
Definition eprop_archiving_node.h:159
virtual long model_dependent_history_shift_() const =0
Returns the correct shift for history depending on whether it is a normal or a bsshslm_2020 model.
const long delay_rec_out_
Transmission delay from recurrent to output neurons.
Definition eprop_archiving_node.h:174
double get_eprop_history_duration() const
Retrieves eprop history size.
Definition eprop_archiving_node_impl.h:282
void register_eprop_connection() override
Registers an eprop connection.
Definition eprop_archiving_node_impl.h:56
std::vector< HistEntryEpropUpdate >::iterator get_update_history(const long time_step)
Retrieves the update history entry for a specific time step.
Definition eprop_archiving_node_impl.h:150
void erase_used_eprop_history() override
Erases the used eprop history for bsshslm_2020 models.
Definition eprop_archiving_node_impl.h:164
const long delay_out_rec_
Transmission delay from output neurons to recurrent neurons.
Definition eprop_archiving_node.h:180
void initialize_update_history() override
Initializes the update history.
Definition eprop_archiving_node_impl.h:63
const long delay_in_rec_
Transmission delay from input to recurrent neurons.
Definition eprop_archiving_node.h:171
const long delay_out_norm_
Transmission delay between output neurons for normalization.
Definition eprop_archiving_node.h:177
size_t eprop_indegree_
Number of incoming eprop synapses.
Definition eprop_archiving_node.h:153
long get_eprop_isi_trace_cutoff() const
Retrieves the eprop ISI trace cutoff.
Definition eprop_archiving_node.h:139
void require_eprop_history_entry(const typename std::vector< HistEntryT >::iterator eprop_hist_it, const long time_step) const
Requires that an e-prop history iterator points to the expected time step.
Definition eprop_archiving_node_impl.h:127
const long offset_gen_
Offset since generator signals start from time step 1.
Definition eprop_archiving_node.h:168
Class implementing a flush event mechanism for neuron models.
Definition flush_event_mechanism.h:43
Class implementing an ignore-and-fire mechanism for neuron models.
Definition ignore_and_spike_mechanism.h:40
Base class for all NEST network objects.
Definition node.h:99
Definition nest_time.h:135
long get_steps() const
Definition nest_time.h:504
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
Declarations for base class Node.
Definition nest_time.h:255