NEST  2.6.0,not_revisioned_source_dir@0
tsodyks_connection.h
Go to the documentation of this file.
1 /*
2  * tsodyks_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 TSODYKS_CONNECTION_H
24 #define TSODYKS_CONNECTION_H
25 
26 
27 
28 /* BeginDocumentation
29  Name: tsodyks_synapse - Synapse type with short term plasticity.
30 
31  Description:
32  This synapse model implements synaptic short-term depression and short-term facilitation
33  according to [1]. In particular it solves Eqs (3) and (4) from this paper in an
34  exact manner.
35 
36  Synaptic depression is motivated by depletion of vesicles in the readily releasable pool
37  of synaptic vesicles (variable x in equation (3)). Synaptic facilitation comes about by
38  a presynaptic increase of release probability, which is modeled by variable U in Eq (4).
39  The original interpretation of variable y is the amount of glutamate concentration in
40  the synaptic cleft. In [1] this variable is taken to be directly proportional to the
41  synaptic current caused in the postsynaptic neuron (with the synaptic weight w as a
42  proportionality constant). In order to reproduce the results of [1] and to use this
43  model of synaptic plasticity in its original sense, the user therefore has to ensure
44  the following conditions:
45 
46  1.) The postsynaptic neuron must be of type iaf_psc_exp or iaf_tum_2000, because
47  these neuron models have a postsynaptic current which decays exponentially.
48 
49  2.) The time constant of each tsodyks_synapse targeting a particular neuron
50  must be chosen equal to that neuron's synaptic time constant. In particular that means
51  that all synapses targeting a particular neuron have the same parameter tau_psc.
52 
53  However, there are no technical restrictions using this model of synaptic plasticity
54  also in conjunction with neuron models that have a different dynamics for their synaptic
55  current or conductance. The effective synaptic weight, which will be transmitted
56  to the postsynaptic neuron upon occurrence of a spike at time t is u(t)*x(t)*w, where
57  u(t) and x(t) are defined in Eq (3) and (4), w is the synaptic weight specified upon
58  connection.
59  The interpretation is as follows: The quantity u(t)*x(t) is the release probability
60  times the amount of releasable synaptic vesicles at time t of the presynaptic neuron's
61  spike, so this equals the amount of transmitter expelled into the synaptic cleft.
62  The amount of transmitter than relaxes back to 0 with time constant tau_psc of the
63  synapse's variable y.
64  Since the dynamics of y(t) is linear, the postsynaptic neuron can reconstruct from the
65  amplitude of the synaptic impulse u(t)*x(t)*w the full shape of y(t).
66  The postsynaptic neuron, however, might choose to have a synaptic current that is not
67  necessarily identical to the concentration of transmitter y(t) in the synaptic cleft.
68  It may realize an arbitrary postsynaptic effect depending on y(t).
69 
70  Parameters:
71  The following parameters can be set in the status dictionary:
72  Us double - maximum probability of realease [0,1]
73  tau_pscs double - time constants of synaptic current in ms
74  tau_facs double - time constant for facilitation in ms
75  tau_recs double - time constant for depression in ms
76  xs double - initial fraction of synaptic vesicles in the readily releasable pool [0,1]
77  ys double - initial fraction of synaptic vesicles in the synaptic cleft [0,1]
78 
79  References:
80  [1] Tsodyks, Uziel, Markram (2000) Synchrony Generation in Recurrent Networks
81  with Frequency-Dependent Synapses. Journal of Neuroscience, vol 20 RC50
82 
83  Transmits: SpikeEvent
84 
85  FirstVersion: March 2006
86  Author: Moritz Helias
87  SeeAlso: synapsedict, stdp_synapse, static_synapse, iaf_psc_exp, iaf_tum_2000
88 */
89 
90 
97 #include "connection.h"
98 #include <cmath>
99 
100 namespace nest {
101 
102 template<typename targetidentifierT>
103 class TsodyksConnection : public Connection<targetidentifierT>
104 {
105  public:
106 
109 
115 
121 
126 
127  // Explicitly declare all methods inherited from the dependent base ConnectionBase.
128  // This avoids explicit name prefixes in all places these functions are used.
129  // Since ConnectionBase depends on the template parameter, they are not automatically
130  // found in the base class.
135 
139  void get_status(DictionaryDatum & d) const;
140 
144  void set_status(const DictionaryDatum & d, ConnectorModel &cm);
145 
152  void send(Event& e, thread t,double_t t_lastspike, const CommonSynapseProperties &cp);
153 
155  {
156  public:
157  // Ensure proper overriding of overloaded virtual functions.
158  // Return values from functions are ignored.
161  };
162 
164  {
165  ConnTestDummyNode dummy_target;
166  ConnectionBase::check_connection_(dummy_target, s, t, receptor_type);
167  }
168 
170 
171  private:
180 };
181 
182 
189 template<typename targetidentifierT>
190 inline
192 {
193  double_t h = e.get_stamp().get_ms() - t_lastspike;
194 
195 
196  Node *target = get_target(t);
197 
198 
199 
200  // t_lastspike_ = 0 initially
201  // this has no influence on the dynamics, IF y = z = 0 initially
202  // !!! x != 1.0 -> z != 0.0 -> t_lastspike_=0 has influence on dynamics
203 
204  // propagator
205  // TODO: use expm1 here instead, where applicable
206  double_t Puu = (tau_fac_ == 0.0) ? 0.0 : std::exp(-h/tau_fac_);
207  double_t Pyy = std::exp(-h/tau_psc_);
208  double_t Pzz = std::exp(-h/tau_rec_);
209 
210  //double_t Pzy = (Pyy - Pzz) * tau_rec_ / (tau_psc_ - tau_rec_);
211  double_t Pxy = ((Pzz - 1.0)*tau_rec_ - (Pyy - 1.0)*tau_psc_) / (tau_psc_ - tau_rec_);
212  double_t Pxz = 1.0 - Pzz;
213 
214  double_t z = 1.0 - x_ - y_;
215 
216  // propagation t_lastspike -> t_spike
217  // don't change the order !
218 
219  u_ *= Puu;
220  x_ += Pxy * y_ + Pxz * z;
221  //z = Pzz * z_ + Pzy * y_;
222  y_ *= Pyy;
223 
224  // delta function u
225  u_ += U_*(1.0-u_);
226 
227  // postsynaptic current step caused by incoming spike
228  double_t delta_y_tsp = u_*x_;
229 
230  // delta function x, y
231  x_ -= delta_y_tsp;
232  y_ += delta_y_tsp;
233 
234 
235  e.set_receiver(*target);
236  e.set_weight(delta_y_tsp*weight_);
237  e.set_delay(get_delay_steps());
238  e.set_rport(get_rport());
239  e();
240 }
241 
242  template<typename targetidentifierT>
244  ConnectionBase(),
245  weight_(1.0),
246  tau_psc_(3.0),
247  tau_fac_(0.0),
248  tau_rec_(800.0),
249  U_(0.5),
250  x_(1.0),
251  y_(0.0),
252  u_(0.0)
253  { }
254 
255  template<typename targetidentifierT>
257  ConnectionBase(rhs),
258  weight_(rhs.weight_),
259  tau_psc_(rhs.tau_psc_),
260  tau_fac_(rhs.tau_fac_),
261  tau_rec_(rhs.tau_rec_),
262  U_(rhs.U_),
263  x_(rhs.x_),
264  y_(rhs.y_),
265  u_(rhs.u_)
266  { }
267 
268  template<typename targetidentifierT>
270  {
271  ConnectionBase::get_status(d);
272  def<double_t>(d, names::weight, weight_);
273 
274  def<double_t>(d, "U", U_);
275  def<double_t>(d, "tau_psc", tau_psc_);
276  def<double_t>(d, "tau_rec", tau_rec_);
277  def<double_t>(d, "tau_fac", tau_fac_);
278  def<double_t>(d, "x", x_);
279  def<double_t>(d, "y", y_);
280  def<double_t>(d, "u", u_);
281  def<long_t>(d, names::size_of, sizeof(*this));
282  }
283 
284  template<typename targetidentifierT>
286  {
287  // Handle parameters that may throw an exception first, so we can leave the synapse untouched
288  // in case of invalid parameter values
289  double_t x = x_;
290  double_t y = y_;
291  updateValue<double_t>(d, "x", x);
292  updateValue<double_t>(d, "y", y);
293 
294  if (x + y > 1.0)
295  throw BadProperty("x + y must be <= 1.0.");
296 
297  x_ = x;
298  y_ = y;
299 
300  ConnectionBase::set_status(d, cm);
301  updateValue<double_t>(d, names::weight, weight_);
302 
303  updateValue<double_t>(d, "U", U_);
304  updateValue<double_t>(d, "tau_psc", tau_psc_);
305  updateValue<double_t>(d, "tau_rec", tau_rec_);
306  updateValue<double_t>(d, "tau_fac", tau_fac_);
307 
308  updateValue<double_t>(d, "u", u_);
309  }
310 
311 } // namespace
312 
313 #endif // TSODYKS_CONNECTION_H
~TsodyksConnection()
Default Destructor.
Definition: tsodyks_connection.h:125
void set_rport(rport p)
Set the receiver port number (r-port).
Definition: event.h:817
void set_receiver(Node &)
Change pointer to receiving Node.
Definition: event.h:708
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
TsodyksConnection()
Default Constructor.
Definition: tsodyks_connection.h:243
Definition: lockptrdatum.h:40
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
long_t get_delay_steps() const
Return the delay of the connection in steps.
Definition: connection.h:126
void check_connection_(Node &dummy_target, Node &source, Node &target, rport receptor_type)
This function calls check_connection() on the sender to check if the receiver accepts the event type ...
Definition: connection.h:183
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: tsodyks_connection.h:160
const rport invalid_port_
Value for invalid connection port number.
Definition: nest.h:160
const Name weight("weight")
Connection parameters.
Definition: nest_names.h:344
Encapsulates information which is sent between Nodes.
Definition: event.h:73
double_t u_
actual probability of release
Definition: tsodyks_connection.h:179
void set_weight(weight t)
Set weight of the event.
Definition: event.h:751
void check_connection(Node &s, Node &t, rport receptor_type, double_t, const CommonPropertiesType &)
Definition: tsodyks_connection.h:163
void set_weight(double_t w)
Definition: tsodyks_connection.h:169
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
double_t tau_rec_
[ms] time constant for recovery
Definition: tsodyks_connection.h:175
void set_status(const DictionaryDatum &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition: tsodyks_connection.h:285
Node * get_target(thread t) const
Definition: connection.h:155
const Name h("h")
Summed input to a neuron (Ginzburg neuron)
Definition: nest_names.h:158
double_t get_delay() const
Return the delay of the connection in ms.
Definition: connection.h:121
Connection< targetidentifierT > ConnectionBase
Definition: tsodyks_connection.h:108
const Name w("w")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:343
const Name y("y")
Definition: topology_names.h:52
void set_delay(delay)
Set the transmission delay of the event.
Definition: event.h:781
double_t tau_fac_
[ms] time constant for fascilitation
Definition: tsodyks_connection.h:174
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
double_t U_
asymptotic value of probability of release
Definition: tsodyks_connection.h:176
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
Base class for dummy nodes used in connection testing.
Definition: connection.h:64
Definition: tsodyks_connection.h:103
void send(Event &e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition: tsodyks_connection.h:191
Definition: tsodyks_connection.h:154
const Name x("x")
current scaling factor of the synaptic weight [0...1] (Tsodyks2_connection)
Definition: nest_names.h:356
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition: exceptions.h:420
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
double double_t
Double precision floating point numbers.
Definition: nest.h:93
CommonSynapseProperties CommonPropertiesType
Definition: tsodyks_connection.h:107
rport get_rport() const
Definition: connection.h:156
virtual port handles_test_event(SpikeEvent &, rport receptor_type)
Check if the node can handle a particular event and receptor type.
Definition: node.cpp:203
double_t tau_psc_
[ms] time constant of postsyn current
Definition: tsodyks_connection.h:173
double_t get_ms() const
Definition: nest_time.h:389
double_t weight_
Definition: tsodyks_connection.h:172
const Name size_of("sizeof")
Connection parameters.
Definition: nest_names.h:259
Class containing the common properties for all connections of a certain type.
Definition: common_synapse_properties.h:44
Base class for representing connections.
Definition: connection.h:85
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
Definition: connector_model.h:38
int_t thread
Thread index type.
Definition: nest.h:133
const double e
Definition: numerics.cpp:62
double_t y_
amount of resources in active state
Definition: tsodyks_connection.h:178
void get_status(DictionaryDatum &d) const
Get all properties of this connection and put them into a dictionary.
Definition: tsodyks_connection.h:269
double_t x_
amount of resources in recovered state
Definition: tsodyks_connection.h:177