NEST main@caf0ae8
 
Loading...
Searching...
No Matches
quantal_stp_synapse.h
Go to the documentation of this file.
1/*
2 * quantal_stp_synapse.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 QUANTAL_STP_SYNAPSE_H
24#define QUANTAL_STP_SYNAPSE_H
25
26// Includes from nestkernel:
27#include "connection.h"
28
29namespace nest
30{
31
32/* BeginUserDocs: synapse, chemical, functional, stp
33
34Short description
35+++++++++++++++++
36
37Probabilistic synapse model with short term plasticity
38
39Description
40+++++++++++
41
42This synapse model implements synaptic short-term depression and
43short-term facilitation according to the quantal release model
44described by Fuhrmann et al. :footcite:p:`Fuhrmann2002` and Loebel et al. :footcite:p:`Loebel2009`.
45
46Each presynaptic spike will stochastically activate a fraction of
47the available release sites. This fraction is binomialy
48distributed and the release probability per site is governed by the
49Fuhrmann et al. (2002) model. The solution of the differential
50equations is taken from Maass and Markram 2002 :footcite:p:`Maass2002`.
51
52The connection weight is interpreted as the maximal weight that can
53be obtained if all n release sites are activated.
54
55.. warning::
56
57 This synaptic plasticity rule does not take
58 :ref:`precise spike timing <sim_precise_spike_times>` into
59 account. When calculating the weight update, the precise spike time part
60 of the timestamp is ignored.
61
62Parameters
63++++++++++
64
65The following parameters can be set in the status dictionary:
66
67========== ======= =========================================================
68 U real Maximal fraction of available resources [0,1],
69 default = 0.5
70 u real Available fraction of resources [0,1], default = U
71 n integer Total number of release sites, default = 1
72 a integer Number of available release sites, default = n
73 tau_fac ms Time constant for facilitation, default = 0 (off)
74 tau_rec ms Time constant for depression, default = 800
75========== ======= =========================================================
76
77References
78++++++++++
79
80.. footbibliography::
81
82Transmits
83+++++++++
84
85SpikeEvent
86
87See also
88++++++++
89
90tsodyks2_synapse, stdp_synapse, static_synapse
91
92Examples using this model
93+++++++++++++++++++++++++
94
95.. listexamples:: quantal_stp_synapse
96
97EndUserDocs */
98
99void register_quantal_stp_synapse( const std::string& name );
100
101template < typename targetidentifierT >
102class quantal_stp_synapse : public Connection< targetidentifierT >
103{
104public:
107
111
117
123
124 // Explicitly declare all methods inherited from the dependent base
125 // ConnectionBase. This avoids explicit name prefixes in all places these
126 // functions are used. Since ConnectionBase depends on the template parameter,
127 // they are not automatically found in the base class.
132
136 void get_status( Dictionary& d ) const;
137
142 void set_status( const Dictionary& d, ConnectorModel& cm );
143
149 bool send( Event& e, size_t t, const CommonSynapseProperties& cp );
150
152 {
153 public:
154 // Ensure proper overriding of overloaded virtual functions.
155 // Return values from functions are ignored.
157 size_t
158 handles_test_event( SpikeEvent&, size_t ) override
159 {
160 return invalid_port;
161 }
162 };
163
164 void
165 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
166 {
167 ConnTestDummyNode dummy_target;
168 ConnectionBase::check_connection_( dummy_target, s, t, receptor_type );
169 }
170
171 void
172 set_weight( double w )
173 {
174 weight_ = w;
175 }
176
177private:
178 double weight_;
179 double U_;
180 double u_;
181 double tau_rec_;
182 double tau_fac_;
183 int n_;
184 int a_;
186};
187
188template < typename targetidentifierT >
190
197template < typename targetidentifierT >
198inline bool
200{
201 const double t_spike = e.get_stamp().get_ms();
202
203 if ( t_lastspike_ >= 0.0 )
204 {
205 // only update a and u if this is not the first spike to pass through the synapse
206
207 // Compute the decay factors, based on the time since the last spike.
208 const double h = t_spike - t_lastspike_;
209 const double p_decay = std::exp( -h / tau_rec_ );
210 const double u_decay = ( tau_fac_ < 1.0e-10 ) ? 0.0 : std::exp( -h / tau_fac_ );
211
212 // Compute release probability
213 u_ = U_ + u_ * ( 1. - U_ ) * u_decay; // Eq. 4 from Loebel et al. (2009)
214
215 // Compute number of sites that recovered during the interval.
216 for ( int depleted = n_ - a_; depleted > 0; --depleted )
217 {
218 if ( get_vp_specific_rng( t )->drand() < ( 1.0 - p_decay ) )
219 {
220 ++a_;
221 }
222 }
223 }
224
225 // Compute number of released sites
226 int n_release = 0;
227 for ( int i = a_; i > 0; --i )
228 {
229 if ( get_vp_specific_rng( t )->drand() < u_ )
230 {
231 ++n_release;
232 }
233 }
234
235 const bool send_spike = n_release > 0;
236
237 if ( send_spike )
238 {
239 e.set_receiver( *get_target( t ) );
240 e.set_weight( n_release * weight_ );
241 e.set_delay_steps( get_delay_steps() );
242 e.set_rport( get_rport() );
243 e();
244 a_ -= n_release;
245 }
246
247 t_lastspike_ = t_spike;
248
249 return send_spike;
250}
251
252} // namespace
253
254#endif // QUANTAL_STP_SYNAPSE_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
virtual double drand()=0
Uses the wrapped RNG engine to draw a double from a uniform distribution in the range [0,...
Class containing the common properties for all connections of a certain type.
Definition common_synapse_properties.h:50
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
double get_delay() const
Return the delay of the connection in ms.
Definition connection.h:172
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
Event for spike information.
Definition event.h:418
Definition quantal_stp_synapse.h:152
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition quantal_stp_synapse.h:158
Definition quantal_stp_synapse.h:103
double t_lastspike_
Time point of last spike emitted.
Definition quantal_stp_synapse.h:185
Connection< targetidentifierT > ConnectionBase
Definition quantal_stp_synapse.h:106
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition quantal_stp_synapse_impl.h:52
double tau_fac_
[ms] time constant for facilitation (F)
Definition quantal_stp_synapse.h:182
double tau_rec_
[ms] time constant for recovery from depression (D)
Definition quantal_stp_synapse.h:181
double u_
dynamic value of probability of release
Definition quantal_stp_synapse.h:180
bool send(Event &e, size_t t, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition quantal_stp_synapse.h:199
double weight_
synaptic weight
Definition quantal_stp_synapse.h:178
void set_weight(double w)
Definition quantal_stp_synapse.h:172
CommonSynapseProperties CommonPropertiesType
Definition quantal_stp_synapse.h:105
quantal_stp_synapse()
Default Constructor.
Definition quantal_stp_synapse_impl.h:37
double U_
unit increment of a facilitating synapse (U)
Definition quantal_stp_synapse.h:179
quantal_stp_synapse & operator=(const quantal_stp_synapse &)=default
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition quantal_stp_synapse.h:165
int a_
Number of available release sites.
Definition quantal_stp_synapse.h:184
void set_status(const Dictionary &d, ConnectorModel &cm)
Set default properties of this connection from the values given in dictionary.
Definition quantal_stp_synapse_impl.h:67
int n_
Number of release sites.
Definition quantal_stp_synapse.h:183
quantal_stp_synapse(const quantal_stp_synapse &)=default
Copy constructor to propagate common properties.
static constexpr ConnectionModelProperties properties
Definition quantal_stp_synapse.h:108
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
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
RngPtr get_vp_specific_rng(size_t tid)
Definition kernel_manager.h:298
void register_quantal_stp_synapse(const std::string &name)
Definition quantal_stp_synapse.cpp:33
ConnectionModelProperties
Definition connector_model.h:49
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141