-
Notifications
You must be signed in to change notification settings - Fork 1
/
tm_synpase_all.py
164 lines (123 loc) · 7.28 KB
/
tm_synpase_all.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 10 20:31:42 2024
@author: celinesoeiro
"""
import numpy as np
from model_functions import homogeneous_poisson, tm_syn_excit_dep, tm_syn_excit_fac, tm_syn_inib_dep, tm_syn_inib_fac
ms = 1000 # 1ms
rate = 20 * 1/ms # spike rate
bin_size = 1 # bin size
tmax = 1 * ms # the total lenght of the spike train
dt = rate
# Izhikevich neuron model
vp = 30 # voltage peak
vr = -65 # voltage threshold
W = 100
random_factor = np.random.rand()
neuron_type_rs = 'Disparo Regular (RS)'
a_rs = 0.02
b_rs = 0.2
c_rs = -65 + 15*random_factor**2
d_rs = 8 - 0.6*random_factor**2
I_rs = 10
neuron_type_ib = "Disparo em Rajada (IB)"
a_ib = 0.02
b_ib = 0.2
c_ib = -55 + 15*random_factor**2
d_ib = 4 - 0.6*random_factor**2
I_ib = 10
neuron_type_fs = "Disparo Rapido (FS)"
a_fs = 0.1 + 0.008*random_factor
b_fs = 0.2 - 0.005*random_factor
c_fs = -65
d_fs = 2
I_fs = 10
neuron_type_lts = "Baixo Limiar de Disparo (LTS)"
a_lts = 0.02 + 0.008*random_factor
b_lts = 0.25 - 0.005*random_factor
c_lts = -65
d_lts = 2
I_lts = 10
neuron_type_tc = "Rele Talamo-cortical (TC)"
a_tc = 0.02 + 0.008*random_factor
b_tc = 0.25 - 0.005*random_factor
c_tc = -65
d_tc = 0.05
I_tc = 10
neuron_type_tr = "Talamo Reticular (TR)"
a_tr = 0.02 + 0.008*random_factor
b_tr = 0.25 - 0.005*random_factor
c_tr = -65
d_tr = 2.05
I_tr = 10
spikes = homogeneous_poisson(rate, tmax, bin_size)
time = np.arange(1,len(spikes)) * bin_size
sim_steps = len(spikes)
# =============================================================================
# REGULAR SPIKING
# =============================================================================
print('-- Excitatory - Depression - RS')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_rs, b=b_rs, c=c_rs, d=d_rs, spikes=spikes, time=time, I=I_rs, W=W, dt=dt, neuron_type=neuron_type_rs)
print('-- Excitatory - Facilitation - RS')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_rs, b=b_rs, c=c_rs, d=d_rs, spikes=spikes, time=time, I=I_rs, W=W, dt=dt, neuron_type=neuron_type_rs)
print('-- Inhibitory - Depression - RS')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_rs, b=b_rs, c=c_rs, d=d_rs, spikes=spikes, time=time, I=I_rs, W=W, dt=dt, neuron_type=neuron_type_rs)
print('-- Inhibitory - Facilitation - RS')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_rs, b=b_rs, c=c_rs, d=d_rs, spikes=spikes, time=time, I=I_rs, W=W, dt=dt, neuron_type=neuron_type_rs)
# =============================================================================
# INTRINSICALLY BURSTING
# =============================================================================
print('-- Excitatory - Depression - IB')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_ib, b=b_ib, c=c_ib, d=d_ib, spikes=spikes, time=time, I=I_ib, W=W, dt=dt, neuron_type=neuron_type_ib)
print('-- Excitatory - Facilitation - IB')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_ib, b=b_ib, c=c_ib, d=d_ib, spikes=spikes, time=time, I=I_ib, W=W, dt=dt, neuron_type=neuron_type_ib)
print('-- Inhibitory - Depression - IB')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_ib, b=b_ib, c=c_ib, d=d_ib, spikes=spikes, time=time, I=I_ib, W=W, dt=dt, neuron_type=neuron_type_ib)
print('-- Inhibitory - Facilitation - IB')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_ib, b=b_ib, c=c_ib, d=d_ib, spikes=spikes, time=time, I=I_ib, W=W, dt=dt, neuron_type=neuron_type_ib)
# =============================================================================
# FAST SPIKING
# =============================================================================
print('-- Excitatory - Depression - FS')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_fs, b=b_fs, c=c_fs, d=d_fs, spikes=spikes, time=time, I=I_fs, W=W, dt=dt, neuron_type=neuron_type_fs)
print('-- Excitatory - Facilitation - FS')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_fs, b=b_fs, c=c_fs, d=d_fs, spikes=spikes, time=time, I=I_fs, W=W, dt=dt, neuron_type=neuron_type_fs)
print('-- Inhibitory - Depression - FS')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_fs, b=b_fs, c=c_fs, d=d_fs, spikes=spikes, time=time, I=I_fs, W=W, dt=dt, neuron_type=neuron_type_fs)
print('-- Inhibitory - Facilitation - FS')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_fs, b=b_fs, c=c_fs, d=d_fs, spikes=spikes, time=time, I=I_fs, W=W, dt=dt, neuron_type=neuron_type_fs)
# =============================================================================
# LOW THRESHOLD SPIKING
# =============================================================================
print('-- Excitatory - Depression - LTS')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_lts, b=b_lts, c=c_lts, d=d_lts, spikes=spikes, time=time, I=I_lts, W=W, dt=dt, neuron_type=neuron_type_lts)
print('-- Excitatory - Facilitation - LTS')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_lts, b=b_lts, c=c_lts, d=d_lts, spikes=spikes, time=time, I=I_lts, W=W, dt=dt, neuron_type=neuron_type_lts)
print('-- Inhibitory - Depression - LTS')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_lts, b=b_lts, c=c_lts, d=d_lts, spikes=spikes, time=time, I=I_lts, W=W, dt=dt, neuron_type=neuron_type_lts)
print('-- Inhibitory - Facilitation - LTS')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_lts, b=b_lts, c=c_lts, d=d_lts, spikes=spikes, time=time, I=I_lts, W=W, dt=dt, neuron_type=neuron_type_lts)
# =============================================================================
# THALAMO CORTICAL
# =============================================================================
print('-- Excitatory - Depression - TC')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tc, b=b_tc, c=c_tc, d=d_tc, spikes=spikes, time=time, I=I_tc, W=W, dt=dt, neuron_type=neuron_type_tc)
print('-- Excitatory - Facilitation - TC')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tc, b=b_tc, c=c_tc, d=d_tc, spikes=spikes, time=time, I=I_tc, W=W, dt=dt, neuron_type=neuron_type_tc)
print('-- Inhibitory - Depression - TC')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tc, b=b_tc, c=c_tc, d=d_tc, spikes=spikes, time=time, I=I_tc, W=W, dt=dt, neuron_type=neuron_type_tc)
print('-- Inhibitory - Facilitation - TC')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tc, b=b_tc, c=c_tc, d=d_tc, spikes=spikes, time=time, I=I_tc, W=W, dt=dt, neuron_type=neuron_type_tc)
# =============================================================================
# THALAMIC RETICULAR
# =============================================================================
print('-- Excitatory - Depression - TR')
tm_syn_excit_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tr, b=b_tr, c=c_tr, d=d_tr, spikes=spikes, time=time, I=I_tr, W=W, dt=dt, neuron_type=neuron_type_tr)
print('-- Excitatory - Facilitation - TR')
tm_syn_excit_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tr, b=b_tr, c=c_tr, d=d_tr, spikes=spikes, time=time, I=I_tr, W=W, dt=dt, neuron_type=neuron_type_tr)
print('-- Inhibitory - Depression - TR')
tm_syn_inib_dep(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tr, b=b_tr, c=c_tr, d=d_tr, spikes=spikes, time=time, I=I_tr, W=W, dt=dt, neuron_type=neuron_type_tr)
print('-- Inhibitory - Facilitation - TR')
tm_syn_inib_fac(sim_steps=sim_steps, vr=vr, vp=vp, a=a_tr, b=b_tr, c=c_tr, d=d_tr, spikes=spikes, time=time, I=I_tr, W=W, dt=dt, neuron_type=neuron_type_tr)