-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFluctExp2Syn.mod
195 lines (164 loc) · 3.49 KB
/
FluctExp2Syn.mod
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
NEURON {
: THREADSAFE
POINT_PROCESS FluctExp2Syn
RANGE tau_rise, tau_fall, cn, mean_amp, cv, type, e, i, s, g, std, std0, pf, plas, tau_plas
RANGE seed, flag_print
NONSPECIFIC_CURRENT i
}
UNITS {
(nA) = (nanoamp)
(mV) = (millivolt)
(uS) = (microsiemens)
}
PARAMETER {
tau_rise = 1.0 (ms) <1e-9,1e9>
tau_fall = 2.0 (ms) <1e-9,1e9>
cn = 4 : (tau_rise/tau_fall)^[-tau_fall/(tau_fall-tau_rise)]
mean_amp = 0.001
cv = 0.0
type = 1
e=0 (mV)
std0 = 1.0
pf = 0.0
plas = 0.75
tau_plas = 120.0
seed = 12
flag_print = 0
}
ASSIGNED {
v (mV)
i (nA)
}
STATE {
s (uS)
g (uS)
std
}
INITIAL {
s = 0
g = 0
std = std0
set_seed(seed)
}
BREAKPOINT {
SOLVE state METHOD cnexp
: obtaining current, whether it is excitatory (default), denoted by type = 1 (exc), or inhibitory, denoted by type = -1
if (type == -1) { : inhibitory
i = -g : current positive (g is negative according to the incoming weights in NET_RECIVE
} else {
i = g * (v-e) / 70 : current negative
}
}
DERIVATIVE state {
s' = -s/tau_rise
g' = (cn*s-g)/tau_fall
std' = -(std-1.0)/tau_plas
}
NET_RECEIVE(w (uS)) {
LOCAL ww, pfail, prob
: w should be equal to mean_amp
: stochastic amplitude
ww = fabs(w*(1+cv*normrand(0,1)))
: clipping response
if (ww > 3*fabs(w)){
ww = 3*fabs(w)
}
: add sign
if (w<0) {
ww = -ww
}
: Includes short-term plasticity
ww = std * ww
: failure of transmission
pfail = pf / std
:scop_random uniform between 0 and 1
prob = scop_random()
if (prob >= pfail) {
s = s + ww : update conductance
std = std * plas : update short-term dynamics
: clipping
if (std >= 5) {
std = 5
}
if (std <= 0.4) {
std = 0.4
}
}
}
COMMENT
with printing options (to check everything is going fine)
NET_RECEIVE(w (uS)) {
LOCAL ww, pfail, prob
: w should be equal to mean_amp
if (flag_print == 1){
VERBATIM
printf("Mean amplitude: %g - ", mean_amp);
ENDVERBATIM
}
: stochastic amplitude
ww = fabs(w*(1+cv*normrand(0,1)))
: clipping response
if (ww > 3*fabs(w)){
ww = 3*fabs(w)
}
: add sign
if (w<0) {
ww = -ww
}
if (flag_print == 1){
VERBATIM
printf("Instantiated Amplitude: %g -> ", _lww);
ENDVERBATIM
}
: Includes short-term plasticity
ww = std * ww
if (flag_print == 1){
VERBATIM
printf("Potentiated: %g\n", _lww);
ENDVERBATIM
}
: failure of transmission
pfail = pf / std
:scop_random uniform between 0 and 1
prob = scop_random()
if (flag_print == 1){
VERBATIM
printf(" Failure probability: %g (prob: %g)\n", _lpfail, _lprob);
printf(" Conductance before (putative) event: %g\n", s);
ENDVERBATIM
}
if (prob >= pfail) {
s = s + ww : update conductance
if (flag_print == 1){
VERBATIM
printf(" Event transmitted\n");
printf(" STD Plasticity before: %g\n", std);
ENDVERBATIM
}
std = std * plas : update short-term dynamics
: clipping
if (std >= 5) {
std = 5
}
if (std <= 0.4) {
std = 0.4
}
if (flag_print == 1){
VERBATIM
printf(" STD Plasticity after: %g\n", std);
ENDVERBATIM
}
} else {
if (flag_print == 1){
VERBATIM
printf(" Event not transmitted\n");
ENDVERBATIM
}
}
if (flag_print == 1){
VERBATIM
printf(" Conductance after (putative) event: %g\n", s);
ENDVERBATIM
}
}
ENDCOMMENT