23#ifndef STDP_TRIPLET_SYNAPSE_H
24#define STDP_TRIPLET_SYNAPSE_H
122template <
typename target
identifierT >
234 return copysign( new_w > 0.0 ? new_w : 0.0,
Wmax_ );
251template <
typename target
identifierT >
260template <
typename target
identifierT >
264 double t_spike = e.get_stamp().get_ms();
265 double dendritic_delay = get_delay();
266 Node* target = get_target( t );
269 std::deque< histentry >::iterator start;
270 std::deque< histentry >::iterator finish;
271 target->get_history( t_lastspike_ - dendritic_delay, t_spike - dendritic_delay, &start, &finish );
274 while ( start != finish )
278 double minus_dt = t_lastspike_ - ( start->t_ + dendritic_delay );
283 double ky = start->Kminus_triplet_ - 1.0;
287 assert( minus_dt < -1.0 *
kernel().connection_manager.get_stdp_eps() );
288 weight_ = facilitate_( weight_, Kplus_ * std::exp( minus_dt / tau_plus_ ), ky );
292 Kplus_triplet_ *= std::exp( ( t_lastspike_ - t_spike ) / tau_plus_triplet_ );
297 weight_ = depress_( weight_, target->get_K_value( t_spike - dendritic_delay ), Kplus_triplet_ );
299 Kplus_triplet_ += 1.0;
300 Kplus_ = Kplus_ * std::exp( ( t_lastspike_ - t_spike ) / tau_plus_ ) + 1.0;
302 e.set_receiver( *target );
303 e.set_weight( weight_ );
304 e.set_delay_steps( get_delay_steps() );
305 e.set_rport( get_rport() );
308 t_lastspike_ = t_spike;
314template <
typename target
identifierT >
319 , tau_plus_triplet_( 101.0 )
322 , Aplus_triplet_( 6.2e-3 )
323 , Aminus_triplet_( 2.3e-4 )
325 , Kplus_triplet_( 0.0 )
327 , t_lastspike_( 0.0 )
331template <
typename target
identifierT >
335 ConnectionBase::get_status( d );
348template <
typename target
identifierT >
352 ConnectionBase::set_status( d, cm );
365 if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) ) == ( ( Wmax_ >= 0 ) - ( Wmax_ < 0 ) ) ) )
367 throw BadProperty(
"Weight and Wmax must have same sign." );
370 if ( not( Kplus_ >= 0 ) )
372 throw BadProperty(
"State Kplus must be positive." );
375 if ( Kplus_triplet_ < 0 )
377 throw BadProperty(
"State Kplus_triplet must be positive." );
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 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
virtual void register_stdp_connection(double, double)
Register a STDP connection.
Definition node.cpp:211
Event for spike information.
Definition event.h:418
Definition stdp_triplet_synapse.h:181
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition stdp_triplet_synapse.h:187
Definition stdp_triplet_synapse.h:124
double tau_plus_
Definition stdp_triplet_synapse.h:239
void set_weight(double w)
Definition stdp_triplet_synapse.h:217
double tau_plus_triplet_
Definition stdp_triplet_synapse.h:240
double Wmax_
Definition stdp_triplet_synapse.h:247
Connection< targetidentifierT > ConnectionBase
Definition stdp_triplet_synapse.h:128
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition stdp_triplet_synapse.h:207
bool send(Event &e, size_t t, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition stdp_triplet_synapse.h:262
double Aplus_triplet_
Definition stdp_triplet_synapse.h:243
double weight_
Definition stdp_triplet_synapse.h:238
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition stdp_triplet_synapse.h:350
double Kplus_triplet_
Definition stdp_triplet_synapse.h:246
double get_delay() const
Return the delay of the connection in ms.
Definition connection.h:172
double Kplus_
Definition stdp_triplet_synapse.h:245
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition stdp_triplet_synapse.h:333
double t_lastspike_
Definition stdp_triplet_synapse.h:248
double facilitate_(double w, double kplus, double ky)
Definition stdp_triplet_synapse.h:224
double depress_(double w, double kminus, double Kplus_triplet_)
Definition stdp_triplet_synapse.h:231
static constexpr ConnectionModelProperties properties
Definition stdp_triplet_synapse.h:130
stdp_triplet_synapse & operator=(const stdp_triplet_synapse &)=default
double Aminus_
Definition stdp_triplet_synapse.h:242
~stdp_triplet_synapse()
Default Destructor.
Definition stdp_triplet_synapse.h:150
double Aplus_
Definition stdp_triplet_synapse.h:241
CommonSynapseProperties CommonPropertiesType
Definition stdp_triplet_synapse.h:127
double Aminus_triplet_
Definition stdp_triplet_synapse.h:244
stdp_triplet_synapse()
Default Constructor.
Definition stdp_triplet_synapse.h:315
stdp_triplet_synapse(const stdp_triplet_synapse &)=default
Copy constructor.
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 Aplus_triplet("Aplus_triplet")
const std::string Kplus_triplet("Kplus_triplet")
const std::string Aminus("Aminus")
const std::string Aplus("Aplus")
const std::string Kplus("Kplus")
const std::string tau_plus("tau_plus")
const std::string tau_plus_triplet("tau_plus_triplet")
const std::string weight("weight")
const std::string Wmax("Wmax")
const std::string Aminus_triplet("Aminus_triplet")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
KernelManager & kernel()
Definition kernel_manager.h:311
void register_stdp_triplet_synapse(const std::string &name)
Definition stdp_triplet_synapse.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141