forked from lbologna/olfactory_bulb_utils
-
Notifications
You must be signed in to change notification settings - Fork 1
/
params.py
189 lines (142 loc) · 4.24 KB
/
params.py
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
# import args
# -*- coding: cp1252 -*-
# bulb spatial definition
bulbCenter = [ 50., 1275., 0. ]
bulbAxis = [ 2100., 2800., 2100.]
glomAxis = [ bulbAxis[i]+300 for i in range(3) ]
granAxisUp = [ bulbAxis[i]-700 for i in range(3) ]
granAxisDw = [ bulbAxis[i]-1500 for i in range(3) ]
GLOM_RADIUS = 50.
# coreneuron parameters
coreneuron = False
gpu = False
filemode = False
"""
try:
from neuron import h
h.celsius = 35
except:
pass
filename = 'cfg27'
def load_params(_filename):
global filename
global stream_last
global stream_orn_w
global stream_orn_act
filename = _filename
try:
module = __import__(filename)
globals().update(vars(module))
stream_last = stream_last_fixed+stream_ods_shift
stream_orn_w = stream_last; stream_last += 6
stream_orn_act = stream_last; stream_last += 1
glom2blanes = []
with open('blanes_exc_conn.txt', 'r') as fi:
l = fi.readline()
while l:
tk = l.split()
glom2blanes.append((int(tk[0]), int(tk[1])))
l = fi.readline()
except:
print('error during params import')
from copy import copy
from math import pi, sqrt
use_fi_stdp = False # FastInhibSTDP vs FastInhib
#plasticity
mc_fi_tau1 = 1
mc_fi_tau2 = 5
mt_fi_tau1 = 1
mt_fi_tau2 = 5
"""
gran_voxel = 17 #19
gran_connect_radius = 41.
mean_synapse_invl = 10.0
glomRealCoords = []
with open('realgloms.txt', 'r') as fi:
line = fi.readline()
while line:
token = line.split()
glomRealCoords.append([ float(token[0]), float(token[1]), float(token[2]) ])
line = fi.readline()
glomRealCoords = glomRealCoords[:127]
# cell numbers
Ngloms = len(glomRealCoords) # glomeruli
# mitral
gid_mitral_begin = 0
Nmitral_per_glom = 5 # mitral per glomerolus
Nmitral = Ngloms * Nmitral_per_glom
# middle tufted
gid_mtufted_begin = gid_mitral_begin+Nmitral
Nmtufted_per_glom = 2*Nmitral_per_glom # twice than mitral!
Nmtufted = Ngloms * Nmtufted_per_glom
gid_granule_begin = gid_mtufted_begin + Nmtufted
import granules
granules.init(bulbCenter, granAxisUp, granAxisDw, gran_voxel, gid_granule_begin)
Ngranule = len(granules.ggid2pos)
gid_blanes_begin = gid_granule_begin+Ngranule
NBlanes_per_glom = 3
NBlanes = Ngloms*NBlanes_per_glom
gid_mbs_begin = gid_blanes_begin+NBlanes
gid_bc2gc_begin = gid_mbs_begin+Nmtufted*NBlanes
# reciprocal synapse
gid_mgrs_begin = gid_bc2gc_begin+NBlanes*Ngranule
if gid_mgrs_begin % 2 != 0:
gid_mgrs_begin += 1
# Random123 secondary stream identifiers
# note: the primary stream index is the "gid" which is ordered as
# Nmitral, Ngranule, synapses
# Not all secondary identifiers are used for all types
"""
stream_last=1
stream_soma = stream_last; stream_last += 1
stream_dend = stream_last; stream_last += 1
stream_apic = stream_last; stream_last += 1
stream_tuft = stream_last; stream_last += 1
stream_latdendconnect = stream_last; stream_last += 1000 #allows per dendrite stream
stream_dsac = stream_last; stream_last += Nmitral+Nmtufted
stream_granule_diam = stream_last; stream_last += 1
stream_granule_type = stream_last; stream_last += 1
stream_granule_dsac = stream_last; stream_last += 8
stream_gap_junction = stream_last; stream_last += 1
stream_blanes = stream_last+Ngranule+Nmtufted; stream_last += 1
stream_blanes_conn = stream_last+Ngranule; stream_last += 1
stream_last_fixed = stream_last
# for the odorstim
stream_last = stream_last_fixed
stream_orn_w = stream_last; stream_last += 6
stream_orn_act = stream_last; stream_last += 1
stream_sniff_delay = stream_last; stream_last += 1
granule_rn_mean = 603.2
granule_rn_std = 363.4/10.
#granule_rn_mean = 728.7
#granule_rn_std = 293.06/10
def ranstream(id1, id2):
r = h.Random()
r.Random123(id1, id2)
return r
# learning
orn_g_mc_std = 1e-4
orn_g_mt_std = 1e-4
if False:
orn_g_mc_baseline = 0
orn_g_mc_max = 15e-3
orn_g_mt_baseline = 0
orn_g_mt_max = 15e-3
else:
orn_g_mc_baseline = 5e-4
orn_g_mc_max = 4e-3
orn_g_mt_baseline = 5e-4
orn_g_mt_max = 10e-3
scrambled_weights = False
gap_junctions_active = True
glomerular_layer = 2
load_params('cfg27')
gc_type3_prob=0
vclamp = []
args = args.parse_arguments()
tstop = args.tstop
coreneuron = args.coreneuron
gpu = args.gpu
filemode = args.filemode
filename = args.filename
"""