-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathD_NeuronGroups_Plasticity.py
162 lines (158 loc) · 10.6 KB
/
D_NeuronGroups_Plasticity.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
from C_Equations import *
###########################################################################################################################
###########################################################################################################################
##################################################### COUPLED SCENARIO ####################################################
###########################################################################################################################
###########################################################################################################################
#####################################################################
########################### PURKINJE CELLS ##########################
#####################################################################
PC_Coupled_STDP = NeuronGroup(N_Cells_PC, model=PC_Equations, threshold='v>Vcut', reset="v=Vr; w+=b", method='euler', name = 'PC_Coupled_STDP',dt=t_Neuron)
for jj in range(0,N_Cells_PC,1):
PC_Coupled_STDP.C[jj] = PC_params['PC_C'][jj]
PC_Coupled_STDP.gL[jj] = PC_params['PC_gL'][jj]
PC_Coupled_STDP.EL[jj] = PC_params['PC_EL'][jj]
PC_Coupled_STDP.VT[jj] = PC_params['PC_VT'][jj]
PC_Coupled_STDP.DeltaT[jj] = PC_params['PC_DeltaT'][jj]
PC_Coupled_STDP.Vcut[jj] = PC_params['PC_VT'][jj] + 5*PC_params['PC_DeltaT'][jj]
PC_Coupled_STDP.tauw[jj] = PC_params['PC_tauw'][jj]
PC_Coupled_STDP.a[jj] = PC_params['PC_a'][jj]
PC_Coupled_STDP.b[jj] = PC_params['PC_b'][jj]
PC_Coupled_STDP.Vr[jj] = PC_params['PC_Vr'][jj]
PC_Coupled_STDP.v[jj] = PC_params['PC_v'][jj]
PC_Coupled_STDP.I_intrinsic[jj] = PC_params['PC_I_intrinsic'][jj]
#print('intrinsic current coupled =',PC_Coupled_STDP.I_intrinsic)
PC_Statemon_Coupled_STDP = StateMonitor(PC_Coupled_STDP, ['v', 'w', 'I_Noise','I_intrinsic','tauw'], record=True,dt=t_Monitor)
PC_Spikemon_Coupled_STDP = SpikeMonitor(PC_Coupled_STDP)
PC_rate_Coupled_STDP = PopulationRateMonitor(PC_Coupled_STDP)
#####################################################################
###################### INFERIOR OLIVARY CELLS #######################
#####################################################################
IO_Coupled_STDP = NeuronGroup(N_Cells_IO, model = eqs_IO, threshold='Vs>20*mV' , method = 'euler',name = 'SchweighoferOlive_Coupled_STDP',dt=t_Neuron)
for ii in range(0, N_Cells_IO, 1):
IO_Coupled_STDP.V_Na[ii] = IO_params['IO_V_Na'][ii]
IO_Coupled_STDP.V_K[ii] = IO_params['IO_V_K'][ii]
IO_Coupled_STDP.V_Ca[ii] = IO_params['IO_V_Ca'][ii]
IO_Coupled_STDP.V_l[ii] = IO_params['IO_V_l'][ii]
IO_Coupled_STDP.V_h[ii] = IO_params['IO_V_h'][ii]
IO_Coupled_STDP.Cm[ii] = IO_params['IO_Cm'][ii]
IO_Coupled_STDP.g_Na[ii] = IO_params['IO_g_Na'][ii]
IO_Coupled_STDP.g_Kdr[ii] = IO_params['IO_g_Kdr'][ii]
IO_Coupled_STDP.g_K_s[ii] = IO_params['IO_g_K_s'][ii]
IO_Coupled_STDP.g_h[ii] = IO_params['IO_g_h'][ii]
IO_Coupled_STDP.g_Ca_h[ii] = IO_params['IO_g_Ca_h'][ii]
IO_Coupled_STDP.g_K_Ca[ii] = IO_params['IO_g_K_Ca'][ii]
IO_Coupled_STDP.g_Na_a[ii] = IO_params['IO_g_Na_a'][ii]
IO_Coupled_STDP.g_K_a[ii] = IO_params['IO_g_K_a'][ii]
IO_Coupled_STDP.g_ls[ii] = IO_params['IO_g_ls'][ii]
IO_Coupled_STDP.g_ld[ii] = IO_params['IO_g_ld'][ii]
IO_Coupled_STDP.g_la[ii] = IO_params['IO_g_la'][ii]
IO_Coupled_STDP.g_int[ii] = IO_params['IO_g_int'][ii]
IO_Coupled_STDP.p[ii] = IO_params['IO_p'][ii]
IO_Coupled_STDP.p2[ii] = IO_params['IO_p2'][ii]
IO_Coupled_STDP.g_Ca_l[ii] = IO_params['IO_g_Ca_l'][ii]
IO_Statemon_Coupled_STDP = StateMonitor(IO_Coupled_STDP, variables = ['Vs','Vd','I_IO_DCN', 'I_c'], record = True, dt=t_Monitor)
IO_Spikemon_Coupled_STDP = SpikeMonitor(IO_Coupled_STDP)
IO_rate_Coupled_STDP = PopulationRateMonitor(IO_Coupled_STDP)
#####################################################################
################### DEEP CEREBELLAR NUCLEI CELLS ####################
#####################################################################
DCN_Coupled_STDP = NeuronGroup(N_Cells_DCN, model=DCN_Equations, threshold='v>Vcut', reset="v=Vr; w+=b", method='euler', name = 'DCN_Coupled_STDP',dt=t_Neuron)
for dd in range(0,N_Cells_DCN,1):
DCN_Coupled_STDP.C[dd] = DCN_params['DCN_C'][dd]
DCN_Coupled_STDP.gL[dd] = DCN_params['DCN_gL'][dd]
DCN_Coupled_STDP.EL[dd] = DCN_params['DCN_EL'][dd]
DCN_Coupled_STDP.VT[dd] = DCN_params['DCN_VT'][dd]
DCN_Coupled_STDP.DeltaT[dd] = DCN_params['DCN_DeltaT'][dd]
DCN_Coupled_STDP.Vcut[dd] = DCN_params['DCN_VT'][dd] + 5*DCN_params['DCN_DeltaT'][dd]
DCN_Coupled_STDP.tauw[dd] = DCN_params['DCN_tauw'][dd]
DCN_Coupled_STDP.a[dd] = DCN_params['DCN_a'][dd]
DCN_Coupled_STDP.b[dd] = DCN_params['DCN_b'][dd]
DCN_Coupled_STDP.Vr[dd] = DCN_params['DCN_Vr'][dd]
DCN_Coupled_STDP.tauI[dd] = DCN_params['DCN_tauI'][dd]
DCN_Coupled_STDP.I_PC_max[dd] = DCN_params['DCN_I_PC_max'][dd]
DCN_Coupled_STDP.v = DCN_params['DCN_v'][dd]
DCN_Coupled_STDP.I_intrinsic[dd] = DCN_params['DCN_I_intrinsic'][dd]
######### Monitors ###############
DCN_Statemon_Coupled_STDP = StateMonitor(DCN_Coupled_STDP, ['v', 'I_PC','w'], record=True,dt=t_Monitor)
DCN_Spikemon_Coupled_STDP = SpikeMonitor(DCN_Coupled_STDP)
DCN_rate_Coupled_STDP = PopulationRateMonitor(DCN_Coupled_STDP)
###########################################################################################################################
###########################################################################################################################
################################################### UNCOUPLED SCENARIO ####################################################
###########################################################################################################################
###########################################################################################################################
#####################################################################
########################### PURKINJE CELLS ##########################
#####################################################################
PC_Uncoupled_STDP = NeuronGroup(N_Cells_PC, model=PC_Equations, threshold='v>Vcut', reset="v=Vr; w+=b", method='euler', name = 'PC_Uncoupled_STDP',dt=t_Neuron)
for jj in range(0,N_Cells_PC,1):
PC_Uncoupled_STDP.C[jj] = PC_params['PC_C'][jj]
PC_Uncoupled_STDP.gL[jj] = PC_params['PC_gL'][jj]
PC_Uncoupled_STDP.EL[jj] = PC_params['PC_EL'][jj]
PC_Uncoupled_STDP.VT[jj] = PC_params['PC_VT'][jj]
PC_Uncoupled_STDP.DeltaT[jj] = PC_params['PC_DeltaT'][jj]
PC_Uncoupled_STDP.Vcut[jj] = PC_params['PC_VT'][jj]+ 5*PC_params['PC_DeltaT'][jj]
PC_Uncoupled_STDP.tauw[jj] = PC_params['PC_tauw'][jj]
PC_Uncoupled_STDP.a[jj] = PC_params['PC_a'][jj]
PC_Uncoupled_STDP.b[jj] = PC_params['PC_b'][jj]
PC_Uncoupled_STDP.Vr[jj] = PC_params['PC_Vr'][jj]
PC_Uncoupled_STDP.v[jj] = PC_params['PC_v'][jj]
PC_Uncoupled_STDP.I_intrinsic[jj] = PC_params['PC_I_intrinsic'][jj]
#PC_I_intrinsic[jj]
#print('intrinsic current uncoupled =',PC_Uncoupled_STDP.I_intrinsic)
PC_Statemon_Uncoupled_STDP = StateMonitor(PC_Uncoupled_STDP, ['v', 'w', 'I_Noise','I_intrinsic','tauw'], record=True,dt=t_Monitor)
PC_Spikemon_Uncoupled_STDP = SpikeMonitor(PC_Uncoupled_STDP)
PC_rate_Uncoupled_STDP = PopulationRateMonitor(PC_Uncoupled_STDP)
#####################################################################
###################### INFERIOR OLIVARY CELLS #######################
#####################################################################
IO_Uncoupled_STDP = NeuronGroup(N_Cells_IO, model = eqs_IO, threshold='Vs>20*mV' , method = 'euler',name = 'SchweighoferOlive_Uncoupled_STDP',dt=t_Neuron)
for ii in range(0, N_Cells_IO, 1):
IO_Uncoupled_STDP.V_Na[ii] = IO_params['IO_V_Na'][ii]
IO_Uncoupled_STDP.V_K[ii] = IO_params['IO_V_K'][ii]
IO_Uncoupled_STDP.V_Ca[ii] = IO_params['IO_V_Ca'][ii]
IO_Uncoupled_STDP.V_l[ii] = IO_params['IO_V_l'][ii]
IO_Uncoupled_STDP.V_h[ii] = IO_params['IO_V_h'][ii]
IO_Uncoupled_STDP.Cm[ii] = IO_params['IO_Cm'][ii]
IO_Uncoupled_STDP.g_Na[ii] = IO_params['IO_g_Na'][ii]
IO_Uncoupled_STDP.g_Kdr[ii] = IO_params['IO_g_Kdr'][ii]
IO_Uncoupled_STDP.g_K_s[ii] = IO_params['IO_g_K_s'][ii]
IO_Uncoupled_STDP.g_h[ii] = IO_params['IO_g_h'][ii]
IO_Uncoupled_STDP.g_Ca_h[ii] = IO_params['IO_g_Ca_h'][ii]
IO_Uncoupled_STDP.g_K_Ca[ii] = IO_params['IO_g_K_Ca'][ii]
IO_Uncoupled_STDP.g_Na_a[ii] = IO_params['IO_g_Na_a'][ii]
IO_Uncoupled_STDP.g_K_a[ii] = IO_params['IO_g_K_a'][ii]
IO_Uncoupled_STDP.g_ls[ii] = IO_params['IO_g_ls'][ii]
IO_Uncoupled_STDP.g_ld[ii] = IO_params['IO_g_ld'][ii]
IO_Uncoupled_STDP.g_la[ii] = IO_params['IO_g_la'][ii]
IO_Uncoupled_STDP.g_int[ii] = IO_params['IO_g_int'][ii]
IO_Uncoupled_STDP.p[ii] = IO_params['IO_p'][ii]
IO_Uncoupled_STDP.p2[ii] = IO_params['IO_p2'][ii]
IO_Uncoupled_STDP.g_Ca_l[ii] = IO_params['IO_g_Ca_l'][ii]
IO_Statemon_Uncoupled_STDP = StateMonitor(IO_Uncoupled_STDP, variables = ['Vs','Vd', 'I_IO_DCN','I_c'], record = True, dt=t_Monitor)
IO_Spikemon_Uncoupled_STDP = SpikeMonitor(IO_Uncoupled_STDP)
IO_rate_Uncoupled_STDP = PopulationRateMonitor(IO_Uncoupled_STDP)
#####################################################################
################### DEEP CEREBELLAR NUCLEI CELLS ####################
#####################################################################
DCN_Uncoupled_STDP = NeuronGroup(N_Cells_DCN, model=DCN_Equations, threshold='v>Vcut', reset="v=Vr; w+=b", method='euler', name = 'DCN_Uncoupled_STDP',dt=t_Neuron)
for dd in range(0,N_Cells_DCN,1):
DCN_Uncoupled_STDP.C[dd] = DCN_params['DCN_C'][dd]
DCN_Uncoupled_STDP.gL[dd] = DCN_params['DCN_gL'][dd]
DCN_Uncoupled_STDP.EL[dd] = DCN_params['DCN_EL'][dd]
DCN_Uncoupled_STDP.VT[dd] = DCN_params['DCN_VT'][dd]
DCN_Uncoupled_STDP.DeltaT[dd] = DCN_params['DCN_DeltaT'][dd]
DCN_Uncoupled_STDP.Vcut[dd] = DCN_params['DCN_VT'][dd] + 5*DCN_params['DCN_DeltaT'][dd]
DCN_Uncoupled_STDP.tauw[dd] = DCN_params['DCN_tauw'][dd]
DCN_Uncoupled_STDP.a[dd] = DCN_params['DCN_a'][dd]
DCN_Uncoupled_STDP.b[dd] = DCN_params['DCN_b'][dd]
DCN_Uncoupled_STDP.Vr[dd] = DCN_params['DCN_Vr'][dd]
DCN_Uncoupled_STDP.tauI[dd] = DCN_params['DCN_tauI'][dd]
DCN_Uncoupled_STDP.I_PC_max[dd] = DCN_params['DCN_I_PC_max'][dd]
DCN_Uncoupled_STDP.v[dd] = DCN_params['DCN_v'][dd]
DCN_Uncoupled_STDP.I_intrinsic[dd] = DCN_params['DCN_I_intrinsic'][dd]
######### Monitors ###############
DCN_Statemon_Uncoupled_STDP = StateMonitor(DCN_Uncoupled_STDP, ['v', 'I_PC','w'], record=True,dt=t_Monitor)
DCN_Spikemon_Uncoupled_STDP = SpikeMonitor(DCN_Uncoupled_STDP)
DCN_rate_Uncoupled_STDP = PopulationRateMonitor(DCN_Uncoupled_STDP)