-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsnn.jl
75 lines (69 loc) · 1.64 KB
/
snn.jl
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
# main file for testing our AdEx SNN implementation
include("AdEx/model.jl");
include("AdEx/model_plots.jl");
## draw up model
A1_microcircuit = [
# Circuit 1
AdEx_Model_Neurons(
T=AdEx_Neuron_Excitatory,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_AMPA,
C=Int[2, 3, 4]
)]
),
AdEx_Model_Neurons(
T=AdEx_Interneuron_PV,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_GABA_B,
C=Int[1, 3]
)]
),
AdEx_Model_Neurons(
T=AdEx_Interneuron_SST,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_GABA_A,
C=Int[1, 2]
)]
),
# Circuit 2
AdEx_Model_Neurons(
T=AdEx_Neuron_Excitatory,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_AMPA,
C=Int[1, 5, 6]
)]
),
AdEx_Model_Neurons(
T=AdEx_Interneuron_PV,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_GABA_B,
C=Int[4, 6]
)]
),
AdEx_Model_Neurons(
T=AdEx_Interneuron_SST,
N=1,
S=[AdEx_Model_Synapses(
T=AdEx_Synapse_GABA_A,
C=Int[4, 5]
)]
)
];
## create models
model = AdEx_Model_Create(A1_microcircuit);
## setup simulation
T = (0ms, 2000ms);
I = [
(1, AdEx_boxcar(T[1]:T[2], 200ms, 1600ms, 2200pA)),
(2, AdEx_boxcar(T[1]:T[2], 200ms, 1600ms, 2200pA))
];
## run a couple of simulations
spikes = AdEx_Model_Simulate(model, T, I; dt=1ms, σ=350pA);
## plot spike trains
display(AdEx_Model_Plot_Neurons(model));
display(AdEx_Plot_Spikes(spikes, T; dt=1ms));