NEST main@caf0ae8
 
Loading...
Searching...
No Matches
tsodyks_synapse_hom.h
Go to the documentation of this file.
1/*
2 * tsodyks_synapse_hom.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 TSODYKS_SYNAPSE_HOM_H
24#define TSODYKS_SYNAPSE_HOM_H
25
26
27// Includes from nestkernel:
29#include "connection.h"
30
31namespace nest
32{
33
34/* BeginUserDocs: synapse, chemical, functional, stp, Tsodyks
35
36Short description
37+++++++++++++++++
38
39Synapse type with short term plasticity using homogeneous parameters
40
41Description
42+++++++++++
43
44This synapse model implements synaptic short-term depression and short-term
45facilitation according to :footcite:p:`Tsodyks2000`. In particular it solves Eqs (3) and (4) from
46this paper in an exact manner.
47
48Synaptic depression is motivated by depletion of vesicles in the readily
49releasable pool of synaptic vesicles (variable x in equation (3)). Synaptic
50facilitation comes about by a presynaptic increase of release probability,
51which is modeled by variable U in Eq (4).
52
53The original interpretation of variable y is the amount of glutamate
54concentration in the synaptic cleft. In :footcite:p:`Tsodyks2000` this variable is taken to be
55directly proportional to the synaptic current caused in the postsynaptic
56neuron (with the synaptic weight w as a proportionality constant). In order
57to reproduce the results of :footcite:p:`Tsodyks2000` and to use this model of synaptic plasticity
58in its original sense, the user therefore has to ensure the following
59conditions:
60
611.) The postsynaptic neuron must be of type ``iaf_psc_exp`` or ``iaf_psc_exp_htum``,
62because these neuron models have a postsynaptic current which decays
63exponentially.
64
652.) The time constant of each ``tsodyks_synapse`` targeting a particular neuron
66must be chosen equal to that neuron's synaptic time constant. In particular
67that means that all synapses targeting a particular neuron have the same
68parameter ``tau_psc``.
69
70However, there are no technical restrictions using this model of synaptic
71plasticity also in conjunction with neuron models that have a different
72dynamics for their synaptic current or conductance. The effective synaptic
73weight, which will be transmitted to the postsynaptic neuron upon occurrence
74of a spike at time t is :math:`u(t) \cdot x(t) \cdot w`, where `u(t)` and `x(t)` are defined in
75Eq (3) and (4), `w` is the synaptic weight specified upon connection.
76The interpretation is as follows: The quantity :math:`u(t) \cdot x(t)` is the release
77probability times the amount of releasable synaptic vesicles at time `t` of the
78presynaptic neuron's spike, so this equals the amount of transmitter expelled
79into the synaptic cleft.
80
81The amount of transmitter then relaxes back to 0 with time constant tau_psc
82of the synapse's variable y. Since the dynamics of y(t) is linear, the
83postsynaptic neuron can reconstruct from the amplitude of the synaptic
84impulse u(t)*x(t)*w the full shape of y(t). The postsynaptic neuron, however,
85might choose to have a synaptic current that is not necessarily identical to
86the concentration of transmitter y(t) in the synaptic cleft. It may realize
87an arbitrary postsynaptic effect depending on y(t).
88
89.. warning::
90
91 This synaptic plasticity rule does not take
92 :ref:`precise spike timing <sim_precise_spike_times>` into
93 account. When calculating the weight update, the precise spike time part
94 of the timestamp is ignored.
95
96Parameters
97++++++++++
98
99======== ====== ========================================================
100 U real Parameter determining the increase in u with each spike
101 [0,1]
102 tau_psc ms Time constant of synaptic current
103 tau_fac ms Time constant for facilitation
104 tau_rec ms Time constant for depression
105 x real Initial fraction of synaptic vesicles in the readily
106 releasable pool [0,1]
107 y real Initial fraction of synaptic vesicles in the synaptic
108 cleft [0,1]
109======== ====== ========================================================
110
111.. note::
112
113 The weight and the parameters U, tau_psc, tau_fac, and tau_rec are
114 common to all synapses of the model and must be set using
115 :py:func:`.SetDefaults` on the synapse model.
116
117References
118++++++++++
119
120.. footbibliography::
121
122Transmits
123+++++++++
124
125SpikeEvent
126
127See also
128++++++++
129
130tsodyks_synapse, stdp_synapse_hom, static_synapse_hom_w
131
132Examples using this model
133+++++++++++++++++++++++++
134
135.. listexamples:: tsodyks_synapse_hom
136
137EndUserDocs */
138
145{
146
147public:
153
157 void get_status( Dictionary& d ) const;
158
162 void set_status( const Dictionary& d, ConnectorModel& cm );
163
164 double tau_psc_;
165 double tau_fac_;
166 double tau_rec_;
167 double U_;
168};
169
170
171void register_tsodyks_synapse_hom( const std::string& name );
172
173template < typename targetidentifierT >
174class tsodyks_synapse_hom : public Connection< targetidentifierT >
175{
176public:
179
183
189
196
201 {
202 }
203
204 // Explicitly declare all methods inherited from the dependent base
205 // ConnectionBase. This avoids explicit name prefixes in all places these
206 // functions are used. Since ConnectionBase depends on the template parameter,
207 // they are not automatically found in the base class.
211
215 void get_status( Dictionary& d ) const;
216
220 void set_status( const Dictionary& d, ConnectorModel& cm );
221
227 bool send( Event& e, size_t t, const TsodyksHomCommonProperties& cp );
228
230 {
231 public:
232 // Ensure proper overriding of overloaded virtual functions.
233 // Return values from functions are ignored.
235 size_t
236 handles_test_event( SpikeEvent&, size_t ) override
237 {
238 return invalid_port;
239 }
240 };
241
242 void
243 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
244 {
245 ConnTestDummyNode dummy_target;
246 ConnectionBase::check_connection_( dummy_target, s, t, receptor_type );
247 }
248
249 void
250 set_weight( double )
251 {
252 throw NotImplemented(
253 "Setting of individual weights is not possible! The common weights can "
254 "be changed via CopyModel()." );
255 }
256
257private:
258 double x_;
259 double y_;
260 double u_;
262};
263
264template < typename targetidentifierT >
266
272template < typename targetidentifierT >
273inline bool
275{
276 const double t_spike = e.get_stamp().get_ms();
277 const double h = t_spike - t_lastspike_;
278
279 // t_lastspike_ = 0 initially
280 // this has no influence on the dynamics, IF y = z = 0 initially
281 // !!! x != 1.0 -> z != 0.0 -> t_lastspike_=0 has influence on dynamics
282
283 // propagator
284 // TODO: use expm1 here instead, where applicable
285 double Puu = ( cp.tau_fac_ == 0.0 ) ? 0.0 : std::exp( -h / cp.tau_fac_ );
286 double Pyy = std::exp( -h / cp.tau_psc_ );
287 double Pzz = std::exp( -h / cp.tau_rec_ );
288
289 double Pxy = ( ( Pzz - 1.0 ) * cp.tau_rec_ - ( Pyy - 1.0 ) * cp.tau_psc_ ) / ( cp.tau_psc_ - cp.tau_rec_ );
290 double Pxz = 1.0 - Pzz;
291
292 double z = 1.0 - x_ - y_;
293
294 // propagation t_lastspike_ -> t_spike
295 // don't change the order !
296
297 u_ *= Puu;
298 x_ += Pxy * y_ + Pxz * z;
299 y_ *= Pyy;
300
301 // delta function u
302 u_ += cp.U_ * ( 1.0 - u_ );
303
304 // postsynaptic current step caused by incoming spike
305 double delta_y_tsp = u_ * x_;
306
307 // delta function x, y
308 x_ -= delta_y_tsp;
309 y_ += delta_y_tsp;
310
311
312 e.set_receiver( *get_target( t ) );
313 e.set_weight( delta_y_tsp * cp.get_weight() );
314 e.set_delay_steps( get_delay_steps() );
315 e.set_rport( get_rport() );
316 e();
317
318 t_lastspike_ = t_spike;
319
320 return true;
321}
322
323template < typename targetidentifierT >
326 , x_( 1.0 )
327 , y_( 0.0 )
328 , u_( 0.0 )
329 , t_lastspike_( 0.0 )
330{
331}
332
333template < typename targetidentifierT >
334void
336{
337 ConnectionBase::get_status( d );
338
339 d[ names::x ] = x_;
340 d[ names::y ] = y_;
341 d[ names::u ] = u_;
342}
343
344template < typename targetidentifierT >
345void
347{
348 // Handle parameters that may throw an exception first, so we can leave the
349 // synapse untouched in case of invalid parameter values
350 double x = x_;
351 double y = y_;
352 d.update_value( names::x, x );
353 d.update_value( names::y, y );
354
355 if ( x + y > 1.0 )
356 {
357 throw BadProperty( "x + y must be <= 1.0." );
358 }
359
360 x_ = x;
361 y_ = y;
362
363 ConnectionBase::set_status( d, cm );
364
365 d.update_value( names::u, u_ );
366}
367
368} // namespace
369
370#endif // TSODYKS_SYNAPSE_HOM_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
Class containing the common properties for all synapses with common weight.
Definition common_properties_hom_w.h:36
double get_weight() const
Definition common_properties_hom_w.h:52
Base class for dummy nodes used in connection testing.
Definition connection.h:67
Base class for representing connections.
Definition connection.h:110
void check_connection_(Node &dummy_target, Node &source, Node &target, const size_t receptor_type)
This function calls check_connection() on the sender to check if the receiver accepts the event type ...
Definition connection.h:319
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
Base class for all NEST network objects.
Definition node.h:99
Exception to be thrown if a feature is unavailable.
Definition exceptions.h:108
Event for spike information.
Definition event.h:418
Class containing the common properties for all synapses of type tsodyks_synapse_hom.
Definition tsodyks_synapse_hom.h:145
double tau_rec_
[ms] time constant for recovery
Definition tsodyks_synapse_hom.h:166
double tau_psc_
[ms] time constant of postsyn current
Definition tsodyks_synapse_hom.h:164
TsodyksHomCommonProperties()
Default constructor.
Definition tsodyks_synapse_hom.cpp:43
double U_
asymptotic value of probability of release
Definition tsodyks_synapse_hom.h:167
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties from the values given in dictionary.
Definition tsodyks_synapse_hom.cpp:64
void get_status(Dictionary &d) const
Get all properties and put them into a dictionary.
Definition tsodyks_synapse_hom.cpp:53
double tau_fac_
[ms] time constant for facilitation
Definition tsodyks_synapse_hom.h:165
Definition tsodyks_synapse_hom.h:230
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition tsodyks_synapse_hom.h:236
Definition tsodyks_synapse_hom.h:175
tsodyks_synapse_hom & operator=(const tsodyks_synapse_hom &)=default
double t_lastspike_
time point of last spike emitted
Definition tsodyks_synapse_hom.h:261
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition tsodyks_synapse_hom.h:335
bool send(Event &e, size_t t, const TsodyksHomCommonProperties &cp)
Send an event to the receiver of this connection.
Definition tsodyks_synapse_hom.h:274
double u_
actual probability of release
Definition tsodyks_synapse_hom.h:260
~tsodyks_synapse_hom()
Default Destructor.
Definition tsodyks_synapse_hom.h:200
Connection< targetidentifierT > ConnectionBase
Definition tsodyks_synapse_hom.h:178
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition tsodyks_synapse_hom.h:243
double y_
amount of resources in active state
Definition tsodyks_synapse_hom.h:259
double x_
amount of resources in recovered state
Definition tsodyks_synapse_hom.h:258
tsodyks_synapse_hom()
Default Constructor.
Definition tsodyks_synapse_hom.h:324
static constexpr ConnectionModelProperties properties
Definition tsodyks_synapse_hom.h:180
tsodyks_synapse_hom(const tsodyks_synapse_hom &)=default
Copy constructor from a property object.
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition tsodyks_synapse_hom.h:346
TsodyksHomCommonProperties CommonPropertiesType
Definition tsodyks_synapse_hom.h:177
void set_weight(double)
Definition tsodyks_synapse_hom.h:250
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
const std::string u("u")
const std::string x("x")
const std::string y("y")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_tsodyks_synapse_hom(const std::string &name)
Definition tsodyks_synapse_hom.cpp:33
ConnectionModelProperties
Definition connector_model.h:49
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141