NEST  2.6.0,not_revisioned_source_dir@0
tsodyks2_connection.h
Go to the documentation of this file.
1 /*
2  * tsodyks2_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 TSODYKS2_CONNECTION_H
24 #define TSODYKS2_CONNECTION_H
25 
26 
27 /* BeginDocumentation
28  Name: tsodyks2_synapse - Synapse type with short term plasticity.
29 
30  Description:
31  This synapse model implements synaptic short-term depression and short-term facilitation
32  according to [1] and [2]. It solves Eq (2) from [1] and modulates U according to eq. (2) of [2].
33 
34  This connection merely scales the synaptic weight, based on the spike history and the
35  parameters of the kinetic model. Thus, it is suitable for all types of synaptic dynamics,
36  that is current or conductance based.
37 
38  The parameter A_se from the publications is represented by the
39  synaptic weight. The variable x in the synapse properties is the
40  factor that scales the synaptic weight.
41 
42  Parameters:
43  The following parameters can be set in the status dictionary:
44  U double - probability of release increment (U1) [0,1], default=0.5
45  u double - Maximum probability of release (U_se) [0,1], default=0.5
46  x double - current scaling factor of the weight, default=U
47  tau_rec double - time constant for depression in ms, default=800 ms
48  tau_rec double - time constant for facilitation in ms, default=0 (off)
49 
50  Notes:
51 
52  Under identical conditions, the tsodyks2_synapse produces
53  slightly lower peak amplitudes than the tsodyks_synapse. However,
54  the qualitative behavior is identical. The script
55  test_tsodyks2_synapse.py in the examples compares the two synapse
56  models.
57 
58 
59  References:
60  [1] Tsodyks, M. V., & Markram, H. (1997). The neural code between neocortical pyramidal neurons
61  depends on neurotransmitter release probability. PNAS, 94(2), 719-23.
62  [2] Fuhrmann, G., Segev, I., Markram, H., & Tsodyks, M. V. (2002). Coding of temporal
63  information by activity-dependent synapses. Journal of neurophysiology, 87(1), 140-8.
64  [3] Maass, W., & Markram, H. (2002). Synapses as dynamic memory buffers. Neural networks, 15(2), 155–61.
65 
66  Transmits: SpikeEvent
67 
68  FirstVersion: October 2011
69  Author: Marc-Oliver Gewaltig, based on tsodyks_synapse by Moritz Helias
70  SeeAlso: tsodyks_synapse, synapsedict, stdp_synapse, static_synapse
71 */
72 
73 
78 #include "connection.h"
79 #include <cmath>
80 
81 namespace nest {
82 
83 template<typename targetidentifierT>
84 class Tsodyks2Connection : public Connection<targetidentifierT>
85 {
86  public:
87 
90 
96 
102 
107 
108  // Explicitly declare all methods inherited from the dependent base ConnectionBase.
109  // This avoids explicit name prefixes in all places these functions are used.
110  // Since ConnectionBase depends on the template parameter, they are not automatically
111  // found in the base class.
116 
120  void get_status(DictionaryDatum & d) const;
121 
125  void set_status(const DictionaryDatum & d, ConnectorModel &cm);
126 
133  void send(Event& e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp);
134 
135 
137  {
138  public:
139  // Ensure proper overriding of overloaded virtual functions.
140  // Return values from functions are ignored.
143  };
144 
145 
147  {
148  ConnTestDummyNode dummy_target;
149  ConnectionBase::check_connection_(dummy_target, s, t, receptor_type);
150  }
151 
153 
154 
155  private:
162 };
163 
164 
171 template<typename targetidentifierT>
172 inline
174 {
175  Node *target = get_target(t);
176 
177  double_t h = e.get_stamp().get_ms() - t_lastspike;
178  double_t x_decay = std::exp(-h/tau_rec_);
179  double_t u_decay = (tau_fac_ < 1.0e-10) ? 0.0 : std::exp(-h/tau_fac_);
180 
181  // now we compute spike number n+1
182  x_= 1. + (x_ -x_*u_ -1.)*x_decay; // Eq. 5 from reference [3]
183  u_= U_+u_*(1.-U_)*u_decay; // Eq. 4 from [3]
184 
185  // We use the current values for the spike number n.
186  e.set_receiver(*target);
187  e.set_weight(x_*u_*weight_);
188  // send the spike to the target
189  e.set_delay(get_delay_steps());
190  e.set_rport(get_rport());
191  e();
192 }
193 
194  template<typename targetidentifierT>
196  ConnectionBase(),
197  weight_(1.0),
198  U_(0.5),
199  u_(U_),
200  x_(1),
201  tau_rec_(800.0),
202  tau_fac_(0.0)
203  {
204  }
205 
206  template<typename targetidentifierT>
208  ConnectionBase(rhs),
209  weight_(rhs.weight_),
210  U_(rhs.U_),
211  u_(rhs.u_),
212  x_(rhs.x_),
213  tau_rec_(rhs.tau_rec_),
214  tau_fac_(rhs.tau_fac_)
215  { }
216 
217 
218  template<typename targetidentifierT>
220  {
221  ConnectionBase::get_status(d);
222  def<double_t>(d, names::weight, weight_);
223 
224  def<double_t>(d, names::dU, U_);
225  def<double_t>(d, names::u, u_);
226  def<double_t>(d, names::tau_rec, tau_rec_);
227  def<double_t>(d, names::tau_fac, tau_fac_);
228  def<double_t>(d, names::x, x_);
229  def<long_t>(d, names::size_of, sizeof(*this));
230  }
231 
232  template<typename targetidentifierT>
234  {
235  ConnectionBase::set_status(d, cm);
236  updateValue<double_t>(d, names::weight, weight_);
237 
238  updateValue<double_t>(d, names::dU, U_);
239  updateValue<double_t>(d, names::u, u_);
240  updateValue<double_t>(d, names::tau_rec, tau_rec_);
241  updateValue<double_t>(d, names::tau_fac, tau_fac_);
242  updateValue<double_t>(d, names::x, x_);
243  }
244 
245 } // namespace
246 
247 #endif // TSODYKS2_CONNECTION_H
double_t U_
unit increment of a facilitating synapse
Definition: tsodyks2_connection.h:157
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
Definition: lockptrdatum.h:40
void get_status(DictionaryDatum &d) const
Get all properties of this connection and put them into a dictionary.
Definition: tsodyks2_connection.h:219
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
const Name tau_fac("tau_fac")
facilitation time constant (ms) (Tsodyks2_connection)
Definition: nest_names.h:289
double_t x_
current fraction of the synaptic weight
Definition: tsodyks2_connection.h:159
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
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
Tsodyks2Connection()
Default Constructor.
Definition: tsodyks2_connection.h:195
void set_weight(weight t)
Set weight of the event.
Definition: event.h:751
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
Node * get_target(thread t) const
Definition: connection.h:155
void set_weight(double_t w)
Definition: tsodyks2_connection.h:152
const Name h("h")
Summed input to a neuron (Ginzburg neuron)
Definition: nest_names.h:158
double_t tau_fac_
[ms] time constant for facilitation
Definition: tsodyks2_connection.h:161
double_t get_delay() const
Return the delay of the connection in ms.
Definition: connection.h:121
const Name w("w")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:343
void set_delay(delay)
Set the transmission delay of the event.
Definition: event.h:781
const Name dU("U")
Unit increment of the utilization for a facilitating synapse [0...1] (Tsodyks2_connection) ...
Definition: nest_names.h:106
const Name tau_rec("tau_rec")
time constant for recovery (ms) (Tsodyks2_connection)
Definition: nest_names.h:296
double_t tau_rec_
[ms] time constant for recovery
Definition: tsodyks2_connection.h:160
double_t u_
dynamic value of probability of release
Definition: tsodyks2_connection.h:158
double_t weight_
Definition: tsodyks2_connection.h:156
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
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: tsodyks2_connection.h:84
const Name x("x")
current scaling factor of the synaptic weight [0...1] (Tsodyks2_connection)
Definition: nest_names.h:356
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
void check_connection(Node &s, Node &t, rport receptor_type, double_t, const CommonPropertiesType &)
Definition: tsodyks2_connection.h:146
double double_t
Double precision floating point numbers.
Definition: nest.h:93
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
CommonSynapseProperties CommonPropertiesType
Definition: tsodyks2_connection.h:88
double_t get_ms() const
Definition: nest_time.h:389
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
void set_status(const DictionaryDatum &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition: tsodyks2_connection.h:233
~Tsodyks2Connection()
Default Destructor.
Definition: tsodyks2_connection.h:106
Base class for representing connections.
Definition: connection.h:85
const Name u("u")
probability of release [0...1] (Tsodyks2_connection)
Definition: nest_names.h:320
Event for spike information.
Definition: event.h:320
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: tsodyks2_connection.h:142
Connection< targetidentifierT > ConnectionBase
Definition: tsodyks2_connection.h:89
void send(Event &e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition: tsodyks2_connection.h:173
Base class for all NEST network objects.
Definition: node.h:96
Definition: tsodyks2_connection.h:136
Definition: connector_model.h:38
int_t thread
Thread index type.
Definition: nest.h:133
const double e
Definition: numerics.cpp:62