Skip to content

Commit f00bc57

Browse files
author
Daniel Incicau
committed
Make dendrite model for excitatory neurons configurable
1 parent 16ce828 commit f00bc57

9 files changed

+265
-162
lines changed

equations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@
4444
dg_is/dt = -g_is/tau_I : siemens
4545
4646
I_s = g_es*(E_e - v_s) + g_is*(E_i - v_s) : amp
47+
K : 1
4748
'''

layer5_CC_CS.py

Lines changed: 120 additions & 46 deletions
Large diffs are not rendered by default.

notebooks/layer5_CC_CS_connection.ipynb

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"PLOT_ONLY_FROM_EQUILIBRIUM=True\n",
2828
"BIN_SIZE_FIRING_RATE = 10\n",
2929
"USE_SYNAPSE_PROBS = True\n",
30-
"USE_DENDRITE_MODEL = True\n",
30+
"USE_DENDRITE_MODEL = False\n",
3131
"\n",
3232
"\n",
3333
"index_to_ntype_dict = {\n",
@@ -55,10 +55,10 @@
5555
"duration = 3*second # Total simulation time\n",
5656
"sim_dt = 0.1*ms # Integrator/sampling step\n",
5757
"\n",
58-
"N_sst = 34 # Number of SST neurons (inhibitory)\n",
59-
"N_pv = 46 # Number of PV neurons (inhibitory)\n",
58+
"N_sst = 34 # Number of SST neurons (inhibitory)\n",
59+
"N_pv = 46 # Number of PV neurons (inhibitory)\n",
6060
"N_cc = 275 # Number of CC neurons (excitatory)\n",
61-
"N_cs = 45 # Number of CS neurons (excitatory)\n",
61+
"N_cs = 45 # Number of CS neurons (excitatory)\n",
6262
"N = [N_cs, N_cc, N_sst, N_pv]\n",
6363
"\n",
6464
"### Neuron parameters\n",
@@ -197,6 +197,7 @@
197197
" dg_is/dt = -g_is/tau_I : siemens\n",
198198
"\n",
199199
" I_s = g_es*(E_e - v_s) + g_is*(E_i - v_s) : amp\n",
200+
" K : 1\n",
200201
"'''"
201202
]
202203
},
@@ -277,20 +278,30 @@
277278
" pv_input_i = PoissonInput(pv_neurons, 'g_e', N=1, rate=lambda_pv, weight=f'I_ext_pv(t, {n_idx})')\n",
278279
"\n",
279280
" # CS Neurons\n",
280-
" cs_neurons = NeuronGroup(N_cs, model=eqs_exc_with_dendrite, threshold='v_s > V_t',\n",
281-
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
282-
" cs_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
283-
" cs_neurons.v_d = -70 * mV\n",
281+
" if USE_DENDRITE_MODEL:\n",
282+
" cs_neurons = NeuronGroup(N_cs, model=eqs_exc_with_dendrite, threshold='v_s > V_t',\n",
283+
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
284+
" cs_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
285+
" cs_neurons.v_d = -70 * mV\n",
286+
" else:\n",
287+
" cs_neurons = NeuronGroup(N_cs, model=eqs_exc_without_dendrite, threshold='v_s > V_t',\n",
288+
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
289+
" cs_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
284290
"\n",
285291
" ## Poisson input to CS neurons\n",
286292
" for n_idx in range(N_cs):\n",
287293
" cs_input_i = PoissonInput(cs_neurons, 'g_es', N=1, rate=lambda_cs, weight=f'I_ext_cs(t, {n_idx})')\n",
288294
"\n",
289295
" # CC Neurons\n",
290-
" cc_neurons = NeuronGroup(N_cc, model=eqs_exc_with_dendrite, threshold='v_s > V_t',\n",
291-
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
292-
" cc_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
293-
" cc_neurons.v_d = -70 * mV\n",
296+
" if USE_DENDRITE_MODEL:\n",
297+
" cc_neurons = NeuronGroup(N_cc, model=eqs_exc_with_dendrite, threshold='v_s > V_t',\n",
298+
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
299+
" cc_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
300+
" cc_neurons.v_d = -70 * mV\n",
301+
" else:\n",
302+
" cc_neurons = NeuronGroup(N_cc, model=eqs_exc_without_dendrite, threshold='v_s > V_t',\n",
303+
" reset='v_s = E_l', refractory=8.3 * ms, method='euler')\n",
304+
" cc_neurons.v_s = 'E_l + rand()*(V_t-E_l)'\n",
294305
"\n",
295306
" ## Poisson input to CC neurons\n",
296307
" for n_idx in range(N_cc):\n",
@@ -336,26 +347,27 @@
336347
" conn_CCsoma_PV.w = conn_weights[CCsoma_PV]\n",
337348
" \n",
338349
" # SST => PYR dendrite\n",
339-
" ## target CS dendrite\n",
340-
" SST_CSdendrite = 3\n",
341-
" conn_SST_CSdendrite = Synapses(sst_neurons, cs_neurons, model='w: 1', on_pre='g_id+=w*nS', name='SST_CSdendrite') # inhibitory\n",
342-
" conn_SST_CSdendrite_prob = conn_probs[SST_CSdendrite] * sst_dendrite_conn_weight\n",
343-
" conn_SST_CSdendrite.connect(p=conn_SST_CSdendrite_prob) # prob divided between soma & dendrite\n",
344-
" conn_SST_CSdendrite.w = conn_weights[SST_CSdendrite]\n",
345-
"\n",
346-
" ## target CC dendrite\n",
347-
" SST_CCdendrite = 8\n",
348-
" conn_SST_CCdendrite = Synapses(sst_neurons, cc_neurons, model='w: 1', on_pre='g_id+=w*nS', name='SST_CCdendrite') # inhibitory\n",
349-
" conn_SST_CCdendrite_prob = conn_probs[SST_CCdendrite] * sst_dendrite_conn_weight\n",
350-
" conn_SST_CCdendrite.connect(p=conn_SST_CCdendrite_prob) # prob divided between soma & dendrite\n",
351-
" conn_SST_CCdendrite.w = conn_weights[SST_CCdendrite]\n",
350+
" if USE_DENDRITE_MODEL:\n",
351+
" ## target CS dendrite\n",
352+
" SST_CSdendrite = 3\n",
353+
" conn_SST_CSdendrite = Synapses(sst_neurons, cs_neurons, model='w: 1', on_pre='g_id+=w*nS', name='SST_CSdendrite') # inhibitory\n",
354+
" conn_SST_CSdendrite_prob = conn_probs[SST_CSdendrite] * sst_dendrite_conn_weight # prob divided between soma & dendrite\n",
355+
" conn_SST_CSdendrite.connect(p=conn_SST_CSdendrite_prob) \n",
356+
" conn_SST_CSdendrite.w = conn_weights[SST_CSdendrite]\n",
357+
"\n",
358+
" ## target CC dendrite\n",
359+
" SST_CCdendrite = 8\n",
360+
" conn_SST_CCdendrite = Synapses(sst_neurons, cc_neurons, model='w: 1', on_pre='g_id+=w*nS', name='SST_CCdendrite') # inhibitory\n",
361+
" conn_SST_CCdendrite_prob = conn_probs[SST_CCdendrite] * sst_dendrite_conn_weight # prob divided between soma & dendrite\n",
362+
" conn_SST_CCdendrite.connect(p=conn_SST_CCdendrite_prob) \n",
363+
" conn_SST_CCdendrite.w = conn_weights[SST_CCdendrite]\n",
352364
"\n",
353365
" # SST <=> PYR soma\n",
354366
" ## target CS soma\n",
355367
" SST_CSsoma = 3\n",
356368
" conn_SST_CSsoma = Synapses(sst_neurons, cs_neurons, model='w: 1', on_pre='g_is+=w*nS', name='SST_CSsoma') # inhibitory (optional connection)\n",
357-
" conn_SST_CSsoma_prob = conn_probs[SST_CSsoma] * sst_soma_conn_weight\n",
358-
" conn_SST_CSsoma.connect(p=conn_SST_CSsoma_prob) # prob divided between soma & dendrite\n",
369+
" conn_SST_CSsoma_prob = conn_probs[SST_CSsoma] * sst_soma_conn_weight if USE_DENDRITE_MODEL else conn_probs[SST_CSsoma] # prob divided between soma & dendrite only if `USE_DENDRITE_MODEL` \n",
370+
" conn_SST_CSsoma.connect(p=conn_SST_CSsoma_prob) \n",
359371
" conn_SST_CSsoma.w = conn_weights[SST_CSsoma]\n",
360372
"\n",
361373
" CSsoma_SST = 1\n",
@@ -366,8 +378,8 @@
366378
" ## taget CC soma\n",
367379
" SST_CCsoma = 8\n",
368380
" conn_SST_CCsoma = Synapses(sst_neurons, cc_neurons, model='w: 1', on_pre='g_is+=w*nS', name='SST_CCsoma') # inhibitory (optional connection)\n",
369-
" conn_SST_CCsoma_prob = conn_probs[SST_CCsoma] * sst_soma_conn_weight\n",
370-
" conn_SST_CCsoma.connect(p=conn_SST_CCsoma_prob) # prob divided between soma & dendrite\n",
381+
" conn_SST_CCsoma_prob = conn_probs[SST_CCsoma] * sst_soma_conn_weight if USE_DENDRITE_MODEL else conn_probs[SST_CCsoma] # prob divided between soma & dendrite only if `USE_DENDRITE_MODEL` \n",
382+
" conn_SST_CCsoma.connect(p=conn_SST_CCsoma_prob)\n",
371383
" conn_SST_CCsoma.w = conn_weights[SST_CCsoma]\n",
372384
"\n",
373385
" CCsoma_SST = 6\n",

notebooks/layer5_SST_Soma_selectivity.ipynb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"PLOT_ONLY_FROM_EQUILIBRIUM=True\n",
2828
"BIN_SIZE_FIRING_RATE = 10\n",
2929
"USE_SYNAPSE_PROBS = True\n",
30-
"USE_DENDRITE_MODEL = True\n",
30+
"\n",
31+
"### This simulation always uses the dendrite model due to applying different weight schemes SST->Soma/Dendrite\n",
32+
"# USE_DENDRITE_MODEL = True\n",
3133
"\n",
3234
"\n",
3335
"index_to_ntype_dict = {\n",
@@ -187,16 +189,6 @@
187189
"\n",
188190
" I_d = g_ed*(E_e - v_d) + g_id*(E_i - v_d) : amp\n",
189191
" K : 1\n",
190-
"'''\n",
191-
"\n",
192-
"# Equations for PYR (excitatory) neurons WITHOUT dendrites\n",
193-
"eqs_exc_without_dendrite = '''\n",
194-
" dv_s/dt = ((E_l-v_s)/tau_S + I_s/C_S) : volt (unless refractory)\n",
195-
"\n",
196-
" dg_es/dt = -g_es/tau_E : siemens\n",
197-
" dg_is/dt = -g_is/tau_I : siemens\n",
198-
"\n",
199-
" I_s = g_es*(E_e - v_s) + g_is*(E_i - v_s) : amp\n",
200192
"'''"
201193
]
202194
},

0 commit comments

Comments
 (0)