NEST main@caf0ae8
 
Loading...
Searching...
No Matches
eprop_learning_signal_connection.h
Go to the documentation of this file.
1/*
2 * eprop_learning_signal_connection.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_LEARNING_SIGNAL_CONNECTION_H
24#define EPROP_LEARNING_SIGNAL_CONNECTION_H
25
26// nestkernel
27#include "connection.h"
28
29namespace nest
30{
31
32/* BeginUserDocs: synapse, abstract, learning, Bellec, e-prop plasticity, 3-factor
33
34Short description
35+++++++++++++++++
36
37Synapse model transmitting feedback learning signals for e-prop plasticity
38
39Description
40+++++++++++
41
42``eprop_learning_signal_connection`` is an implementation of a feedback connector from
43``eprop_readout`` readout neurons to ``eprop_iaf`` or ``eprop_iaf_adapt``
44recurrent neurons that transmits the learning signals :math:`L_j^t` for eligibility propagation (e-prop) plasticity and
45has a static weight :math:`B_{jk}`.
46
47E-prop plasticity was originally introduced and implemented in TensorFlow in :footcite:p:`Bellec2020`.
48
49For more information on e-prop plasticity, see the documentation on the other e-prop models:
50
51 * :doc:`eprop_iaf<../models/eprop_iaf/>`
52 * :doc:`eprop_iaf_adapt<../models/eprop_iaf_adapt/>`
53 * :doc:`eprop_readout<../models/eprop_readout/>`
54 * :doc:`eprop_synapse<../models/eprop_synapse/>`
55
56Details on the event-based NEST implementation of e-prop can be found in :footcite:p:`KorcsakGorzo2025`.
57
58Parameters
59++++++++++
60
61The following parameters can be set in the status dictionary.
62
63========== ===== ================ ======= ===============
64**Individual synapse parameters**
65---------------------------------------------------------
66Parameter Unit Math equivalent Default Description
67========== ===== ================ ======= ===============
68``delay`` ms :math:`d_{jk}` 1.0 Dendritic delay
69``weight`` pA :math:`B_{jk}` 1.0 Synaptic weight
70========== ===== ================ ======= ===============
71
72Recordables
73+++++++++++
74
75The following variables can be recorded. Note that since this connection lacks
76a plasticity mechanism the weight does not evolve over time.
77
78============== ==== =============== ============= ===============
79**Synapse recordables**
80-----------------------------------------------------------------
81State variable Unit Math equivalent Initial value Description
82============== ==== =============== ============= ===============
83``weight`` pA :math:`B_{jk}` 1.0 Synaptic weight
84============== ==== =============== ============= ===============
85
86Usage
87+++++
88
89This model can only be used in combination with the other e-prop models
90and the network architecture requires specific wiring, input, and output.
91The usage is demonstrated in several
92:doc:`supervised regression and classification tasks <../auto_examples/eprop_plasticity/index>`
93reproducing among others the original proof-of-concept tasks in :footcite:p:`Bellec2020`.
94
95Transmits
96+++++++++
97
98LearningSignalConnectionEvent
99
100References
101++++++++++
102
103.. footbibliography::
104
105See also
106++++++++
107
108Examples using this model
109+++++++++++++++++++++++++
110
111.. listexamples:: eprop_learning_signal_connection
112
113EndUserDocs */
114
115void register_eprop_learning_signal_connection( const std::string& name );
116
124template < typename targetidentifierT >
125class eprop_learning_signal_connection : public Connection< targetidentifierT >
126{
127
128public:
131
134
137
141 , weight_( 1.0 )
142 {
143 }
144
146 std::unique_ptr< SecondaryEvent > get_secondary_event();
147
151
153 void
154 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
155 {
157
158 s.sends_secondary_event( ge );
159 ge.set_sender( s );
160 Connection< targetidentifierT >::target_.set_rport( t.handles_test_event( ge, receptor_type ) );
162 }
163
165 bool
166 send( Event& e, size_t t, const CommonSynapseProperties& )
167 {
168 e.set_weight( weight_ );
169 e.set_delay_steps( get_delay_steps() );
170 e.set_receiver( *get_target( t ) );
171 e.set_rport( get_rport() );
172 e();
173 return true;
174 }
175
177 void get_status( Dictionary& d ) const;
178
180 void set_status( const Dictionary& d, ConnectorModel& cm );
181
183 void
184 set_weight( const double w )
185 {
186 weight_ = w;
187 }
188
189private:
191 double weight_;
192};
193
194template < typename targetidentifierT >
196
197template < typename targetidentifierT >
198void
200{
201 ConnectionBase::get_status( d );
202 d[ names::weight ] = weight_;
203 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
204}
205
206template < typename targetidentifierT >
207void
209{
210 ConnectionBase::set_status( d, cm );
211 d.update_value( names::weight, weight_ );
212}
213
214template < typename targetidentifierT >
215std::unique_ptr< SecondaryEvent >
217{
218 return std::make_unique< LearningSignalConnectionEvent >();
219}
220
221} // namespace nest
222
223#endif // EPROP_LEARNING_SIGNAL_CONNECTION_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Class containing the common properties for all connections of a certain type.
Definition common_synapse_properties.h:50
Base class for representing connections.
Definition connection.h:110
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
Node * get_target(const size_t tid) const
Definition connection.h:239
size_t get_rport() const
Definition connection.h:244
Definition connector_model.h:69
Encapsulate information sent between nodes.
Definition event.h:103
void set_sender(Node &)
Change pointer to sending Node.
Definition event.h:920
Event for learning signal connections.
Definition secondary_event.h:384
Base class for all NEST network objects.
Definition node.h:99
Class implementing a feedback connection model for e-prop plasticity with additional biological featu...
Definition eprop_learning_signal_connection.h:126
CommonSynapseProperties CommonPropertiesType
Type of the common synapse properties.
Definition eprop_learning_signal_connection.h:130
bool send(Event &e, size_t t, const CommonSynapseProperties &)
Send the learning signal event.
Definition eprop_learning_signal_connection.h:166
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
static constexpr ConnectionModelProperties properties
Properties of the connection model.
Definition eprop_learning_signal_connection.h:136
Node * get_target(const size_t tid) const
Definition connection.h:239
std::unique_ptr< SecondaryEvent > get_secondary_event()
Get the secondary learning signal event.
Definition eprop_learning_signal_connection.h:216
void set_weight(const double w)
Set the synaptic weight to the provided value.
Definition eprop_learning_signal_connection.h:184
void set_status(const Dictionary &d, ConnectorModel &cm)
Set the values of the model attributes.
Definition eprop_learning_signal_connection.h:208
eprop_learning_signal_connection()
Default constructor.
Definition eprop_learning_signal_connection.h:139
size_t get_rport() const
Definition connection.h:244
double weight_
Synaptic weight.
Definition eprop_learning_signal_connection.h:191
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Check if the target accepts the event and receptor type requested by the sender.
Definition eprop_learning_signal_connection.h:154
Connection< targetidentifierT > ConnectionBase
Type of the connection base.
Definition eprop_learning_signal_connection.h:133
void get_status(Dictionary &d) const
Get the model attributes and their values.
Definition eprop_learning_signal_connection.h:199
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
const std::string weight("weight")
const std::string size_of("sizeof")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_eprop_learning_signal_connection(const std::string &name)
Definition eprop_learning_signal_connection.cpp:32
ConnectionModelProperties
Definition connector_model.h:49