NEST main@caf0ae8
 
Loading...
Searching...
No Matches
eprop_learning_signal_connection_bsshslm_2020.h
Go to the documentation of this file.
1/*
2 * eprop_learning_signal_connection_bsshslm_2020.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_BSSHSLM_2020_H
24#define EPROP_LEARNING_SIGNAL_CONNECTION_BSSHSLM_2020_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_bsshslm_2020`` is an implementation of a feedback connector from
43``eprop_readout_bsshslm_2020`` readout neurons to ``eprop_iaf_bsshslm_2020`` or ``eprop_iaf_adapt_bsshslm_2020``
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
49The suffix ``_bsshslm_2020`` follows the NEST convention to indicate in the
50model name the paper that introduced it by the first letter of the authors' last
51names and the publication year.
52
53For more information on e-prop plasticity, see the documentation on the other e-prop models:
54
55 * :doc:`eprop_iaf_bsshslm_2020<../models/eprop_iaf_bsshslm_2020/>`
56 * :doc:`eprop_iaf_adapt_bsshslm_2020<../models/eprop_iaf_adapt_bsshslm_2020/>`
57 * :doc:`eprop_readout_bsshslm_2020<../models/eprop_readout_bsshslm_2020/>`
58 * :doc:`eprop_synapse_bsshslm_2020<../models/eprop_synapse_bsshslm_2020/>`
59
60Details on the event-based NEST implementation of e-prop can be found in :footcite:p:`KorcsakGorzo2025`.
61
62Parameters
63++++++++++
64
65The following parameters can be set in the status dictionary.
66
67========== ===== ================ ======= ===============
68**Individual synapse parameters**
69---------------------------------------------------------
70Parameter Unit Math equivalent Default Description
71========== ===== ================ ======= ===============
72``delay`` ms :math:`d_{jk}` 1.0 Dendritic delay
73``weight`` pA :math:`B_{jk}` 1.0 Synaptic weight
74========== ===== ================ ======= ===============
75
76Recordables
77+++++++++++
78
79The following variables can be recorded. Note that since this connection lacks
80a plasticity mechanism the weight does not evolve over time.
81
82============== ==== =============== ============= ===============
83**Synapse recordables**
84-----------------------------------------------------------------
85State variable Unit Math equivalent Initial value Description
86============== ==== =============== ============= ===============
87``weight`` pA :math:`B_{jk}` 1.0 Synaptic weight
88============== ==== =============== ============= ===============
89
90Usage
91+++++
92
93This model can only be used in combination with the other e-prop models
94and the network architecture requires specific wiring, input, and output.
95The usage is demonstrated in several
96:doc:`supervised regression and classification tasks <../auto_examples/eprop_plasticity/index>`
97reproducing among others the original proof-of-concept tasks in :footcite:p:`Bellec2020`.
98
99Transmits
100+++++++++
101
102LearningSignalConnectionEvent
103
104References
105++++++++++
106
107.. footbibliography::
108
109See also
110++++++++
111
112Examples using this model
113+++++++++++++++++++++++++
114
115.. listexamples:: eprop_learning_signal_connection_bsshslm_2020
116
117EndUserDocs */
118
119void register_eprop_learning_signal_connection_bsshslm_2020( const std::string& name );
120
127template < typename targetidentifierT >
129{
130
131public:
134
137
140
147
149 std::unique_ptr< SecondaryEvent > get_secondary_event();
150
154
156 void
157 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
158 {
160
161 s.sends_secondary_event( ge );
162 ge.set_sender( s );
163 Connection< targetidentifierT >::target_.set_rport( t.handles_test_event( ge, receptor_type ) );
165 }
166
168 bool
169 send( Event& e, size_t t, const CommonSynapseProperties& )
170 {
171 e.set_weight( weight_ );
172 e.set_delay_steps( get_delay_steps() );
173 e.set_receiver( *get_target( t ) );
174 e.set_rport( get_rport() );
175 e();
176 return true;
177 }
178
180 void get_status( Dictionary& d ) const;
181
183 void set_status( const Dictionary& d, ConnectorModel& cm );
184
186 void
187 set_weight( const double w )
188 {
189 weight_ = w;
190 }
191
192private:
194 double weight_;
195};
196
197template < typename targetidentifierT >
199
200template < typename targetidentifierT >
201void
203{
204 ConnectionBase::get_status( d );
205 d[ names::weight ] = weight_;
206 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
207}
208
209template < typename targetidentifierT >
210void
212 ConnectorModel& cm )
213{
214 ConnectionBase::set_status( d, cm );
215 d.update_value( names::weight, weight_ );
216}
217
218template < typename targetidentifierT >
219std::unique_ptr< SecondaryEvent >
221{
222 return std::make_unique< LearningSignalConnectionEvent >();
223}
224
225} // namespace nest
226
227#endif // EPROP_LEARNING_SIGNAL_CONNECTION_BSSHSLM_2020_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.
Definition eprop_learning_signal_connection_bsshslm_2020.h:129
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
void set_status(const Dictionary &d, ConnectorModel &cm)
Set the values of the model attributes.
Definition eprop_learning_signal_connection_bsshslm_2020.h:211
static constexpr ConnectionModelProperties properties
Properties of the connection model.
Definition eprop_learning_signal_connection_bsshslm_2020.h:139
Node * get_target(const size_t tid) const
Definition connection.h:239
eprop_learning_signal_connection_bsshslm_2020()
Default constructor.
Definition eprop_learning_signal_connection_bsshslm_2020.h:142
size_t get_rport() const
Definition connection.h:244
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_bsshslm_2020.h:157
double weight_
Synaptic weight.
Definition eprop_learning_signal_connection_bsshslm_2020.h:194
void get_status(Dictionary &d) const
Get the model attributes and their values.
Definition eprop_learning_signal_connection_bsshslm_2020.h:202
std::unique_ptr< SecondaryEvent > get_secondary_event()
Get the secondary learning signal event.
Definition eprop_learning_signal_connection_bsshslm_2020.h:220
CommonSynapseProperties CommonPropertiesType
Type of the common synapse properties.
Definition eprop_learning_signal_connection_bsshslm_2020.h:133
Connection< targetidentifierT > ConnectionBase
Type of the connection base.
Definition eprop_learning_signal_connection_bsshslm_2020.h:136
void set_weight(const double w)
Set the synaptic weight to the provided value.
Definition eprop_learning_signal_connection_bsshslm_2020.h:187
bool send(Event &e, size_t t, const CommonSynapseProperties &)
Send the learning signal event.
Definition eprop_learning_signal_connection_bsshslm_2020.h:169
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_bsshslm_2020(const std::string &name)
Definition eprop_learning_signal_connection_bsshslm_2020.cpp:32
ConnectionModelProperties
Definition connector_model.h:49