This repository has been archived by the owner on Jan 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathstdp_triplet_node.h
219 lines (175 loc) · 6.17 KB
/
stdp_triplet_node.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
//
// stdp_triplet_node.h
// NEST
//
//
/* BeginDocumentation
Name: stdp_triplet_node - Neuron that acts like a stdp_triplet_connection.
Description:
stdp_triplet_synapse is a modeled connection with spike time dependent
plasticity accounting for spike triplet effects (as defined in [1]).
STDP examples:
pair-based Aplus_triplet = Aminus_triplet = 0.0
triplet Aplus_triplet = Aminus_triplet = 1.0
nearest-spike nearest_spile = True
Parameters:
Wmax double: maximum allowed weight
Wmin double: minimum allowed weight
neareat_spike bool: states saturate at 1 only taking into account
neighboring spikes
tau_plus double: time constant of short presynaptic trace (tau_plus
of [1])
tau_plus_triplet double: time constant of long presynaptic trace (tau_x of
[1])
tau_minus double: time constant of short postsynaptic trace (tau_minus
of [1])
tau_minus_triplet double: time constant of long postsynaptic trace (tau_y of
[1])
Aplus double: weight of pair potentiation rule (A_plus_2 of [1])
Aplus_triplet double: weight of triplet potentiation rule (A_plus_3 of
[1])
Aminus double: weight of pair depression rule (A_minus_2 of [1])
Aminus_triplet double: weight of triplet depression rule (A_minus_3 of [1])
Notes about delay:
This model does not have any delay parameter as both axonal and dendritic
delays are repectively taken into account by pre-synpatic and post-synaptic
connections. Any parameter tuning should be done at creation time on pynest.
States:
weight double: synaptic weight
Kplus double: pre-synaptic trace (e.g. amount of glutamate
bound...) (r_1 of [1])
Kplus_triplet double: triplet pre-synaptic trace (e.g. number of NMDA
receptors...) (r_2 of [1])
Kminus double: post-synaptic trace (e.g. influx of
calcium
concentration...) (o_1 of [1])
Kminus_triplet double: triplet post-synaptic trace (e.g. number of
secondary messengers...) (o_2 of [1])
Receives: SpikeEvent, DataLoggingRequest
Sends: SpikeEvent
References:
[1] J.-P. Pfister & W. Gerstner (2006) Triplets of Spikes in a Model
of Spike Timing-Dependent Plasticity. The Journal of Neuroscience
26(38):9673-9682; doi:10.1523/JNEUROSCI.1425-06.2006
[2] stdp_triplet_connection.h
FirstVersion: Octo 2015
Author: Alexander Seeholzer, Teo Stocco
SeeAlso: synapsedict, stdp_synapse, static_synapse
*/
#ifndef STDP_TRIPLET_NEURON_H
#define STDP_TRIPLET_NEURON_H
#include "nest.h"
#include "event.h"
#include "archiving_node.h"
#include "ring_buffer.h"
#include "namedatum.h"
#include "universal_data_logger.h"
namespace stdpmodule {
using namespace nest;
class Network;
class STDPTripletNeuron : public Archiving_Node {
public:
STDPTripletNeuron();
STDPTripletNeuron(const STDPTripletNeuron &);
using Node::handle;
using Node::handles_test_event;
port send_test_event(Node &, rport, synindex, bool);
port handles_test_event(SpikeEvent &, rport);
port handles_test_event(DataLoggingRequest &, rport);
void get_status(DictionaryDatum &) const;
void set_status(const DictionaryDatum &);
void handle(SpikeEvent &);
void handle(DataLoggingRequest &);
private:
void init_state_(const Node &proto) {}
void init_buffers_();
void calibrate();
void update(Time const &, const long_t, const long_t);
friend class RecordablesMap<STDPTripletNeuron>;
friend class UniversalDataLogger<STDPTripletNeuron>;
struct Parameters_ {
double_t Wmax_;
double_t Wmin_;
bool nearest_spike_;
double_t tau_plus_;
double_t tau_plus_triplet_;
double_t tau_minus_;
double_t tau_minus_triplet_;
double_t Aplus_;
double_t Aminus_;
double_t Aplus_triplet_;
double_t Aminus_triplet_;
Parameters_();
void get(DictionaryDatum &) const;
void set(const DictionaryDatum &);
};
struct State_ {
double_t weight_;
double_t Kplus_;
double_t Kplus_triplet_;
double_t Kminus_;
double_t Kminus_triplet_;
State_();
void get(DictionaryDatum &) const;
void set(const DictionaryDatum &);
};
struct Buffers_ {
RingBuffer n_pre_spikes_;
RingBuffer n_post_spikes_;
UniversalDataLogger<STDPTripletNeuron> logger_;
Buffers_(STDPTripletNeuron &);
Buffers_(const Buffers_ &, STDPTripletNeuron &);
};
struct Variables_ {
double_t Kplus_decay_;
double_t Kplus_triplet_decay_;
double_t Kminus_decay_;
double_t Kminus_triplet_decay_;
};
// Access functions for UniversalDataLogger
double_t get_weight_() const { return S_.weight_; }
double_t get_Kplus_() const { return S_.Kplus_; }
double_t get_Kplus_triplet_() const { return S_.Kplus_triplet_; }
double_t get_Kminus_() const { return S_.Kminus_; }
double_t get_Kminus_triplet_() const { return S_.Kminus_triplet_; }
Parameters_ P_;
State_ S_;
Variables_ V_;
Buffers_ B_;
static RecordablesMap<STDPTripletNeuron> recordablesMap_;
};
inline port STDPTripletNeuron::send_test_event(Node &target,
rport receptor_type, synindex,
bool) {
SpikeEvent e;
e.set_sender(*this);
return target.handles_test_event(e, receptor_type);
}
inline port STDPTripletNeuron::handles_test_event(SpikeEvent &,
rport receptor_type) {
// Allow connections to port 0 (pre-synaptic) and port 1 (post-synaptic)
if (receptor_type != 0 and receptor_type != 1) {
throw UnknownReceptorType(receptor_type, get_name());
}
return receptor_type;
}
inline port STDPTripletNeuron::handles_test_event(DataLoggingRequest &dlr,
rport receptor_type) {
if (receptor_type != 0) {
throw UnknownReceptorType(receptor_type, get_name());
}
return B_.logger_.connect_logging_device(dlr, recordablesMap_);
}
inline void STDPTripletNeuron::get_status(DictionaryDatum &d) const {
P_.get(d);
S_.get(d);
Archiving_Node::get_status(d);
(*d)[names::recordables] = recordablesMap_.get_list();
}
inline void STDPTripletNeuron::set_status(const DictionaryDatum &d) {
P_.set(d);
S_.set(d);
Archiving_Node::set_status(d);
}
}
#endif // STDP_TRIPLET_NEURON_H