|
9 | 9 | import py_hh as phh
|
10 | 10 | import numpy as np
|
11 | 11 | from numpy import random
|
| 12 | +import matplotlib |
| 13 | +matplotlib.use('Agg') |
12 | 14 | import matplotlib.pylab as pl
|
13 | 15 | pl.ioff()
|
14 | 16 | from distribute_delays import getDelays
|
|
18 | 20 | rank = comm.Get_rank()
|
19 | 21 | size = comm.Get_size()
|
20 | 22 |
|
21 |
| -w_n_range = np.linspace(1.3, 1.5, size, endpoint=False) |
| 23 | +#N = 60 |
| 24 | +w_n_range = np.linspace(1.6, 2.0, size) |
| 25 | + |
| 26 | +#N = 70 |
| 27 | +#w_n_range = np.linspace(1.6, 1.8, size) |
| 28 | + |
| 29 | +# N = 80 |
| 30 | +#w_n_range = np.linspace(1.3, 1.5, size) |
| 31 | + |
| 32 | +# N = 90 |
| 33 | +#w_n_range = np.linspace(1.2, 1.4, size) |
| 34 | + |
| 35 | +#w_n_range = np.linspace(1.1, 1.39, size) |
| 36 | + |
| 37 | +# Neur = 120 |
| 38 | +#w_n_range = np.linspace(1.14, 1.16, size) |
| 39 | + |
| 40 | +# Nneur = 130 |
| 41 | +#w_n_range = np.linspace(1.00, 1.12, size) |
22 | 42 |
|
23 | 43 | random.seed(0)
|
24 | 44 | psn_seed = 0
|
25 | 45 |
|
26 |
| -SimTime = 10000. |
| 46 | +SimTime = 1000000. |
27 | 47 | h = 0.02
|
28 | 48 | Tcutoff = np.iinfo(np.int32).max
|
29 | 49 | Tsim = int(SimTime/h)
|
30 | 50 | recInt = np.iinfo(np.int32).max
|
31 | 51 |
|
32 |
| -w_ps = np.arange(1.88, 1.951, 0.01) |
| 52 | +w_ps = np.arange(1.87, 1.951, 0.01) |
33 | 53 | nw = len(w_ps)
|
34 | 54 |
|
35 |
| -N = 100 |
| 55 | +N = 50 |
36 | 56 | Nneur = N*nw
|
37 | 57 |
|
38 | 58 | tau_psc = 0.2 # ms
|
|
42 | 62 | I0 = 5.27
|
43 | 63 |
|
44 | 64 | rate = np.zeros(Nneur, dtype=fltSize) + 185.0 # Poisson noise rate, Hz (shouldn't be 0)
|
45 |
| -pcon = 0.2 |
| 65 | +pcon = 0.25 |
46 | 66 | Ncon = int(N*N*pcon)
|
47 | 67 | pre = np.zeros(Ncon*nw, dtype='uint32')
|
48 | 68 | post = np.zeros(Ncon*nw, dtype='uint32')
|
|
68 | 88 |
|
69 | 89 | Vrec = np.zeros((int((Tsim + recInt - 1)/recInt), Nneur), dtype=fltSize)
|
70 | 90 |
|
71 |
| -#v0, n0, m0, h0 = 32.906693, 0.574676, 0.913177, 0.223994 |
72 |
| -v0, n0, m0, h0 = -60.8457, 0.3763, 0.0833, 0.4636 |
| 91 | +v0, n0, m0, h0 = 32.906693, 0.574676, 0.913177, 0.223994 |
| 92 | +#v0, n0, m0, h0 = -60.8457, 0.3763, 0.0833, 0.4636 |
73 | 93 | Vm = np.zeros(Nneur, dtype=fltSize) + v0
|
74 | 94 | ns = np.zeros(Nneur, dtype=fltSize) + n0
|
75 | 95 | ms = np.zeros(Nneur, dtype=fltSize) + m0
|
|
85 | 105 | incTimes = np.zeros((NnumSp, Nneur), dtype='uint32')
|
86 | 106 | incSpWeights = np.zeros((NnumSp, Nneur), dtype=fltSize) + wInc*np.e/tau_psc
|
87 | 107 | #%%
|
88 |
| -phh.setCalcParams(rank % 3, Tsim, Tcutoff, Nneur, Ncon*nw, recInt, h) |
| 108 | +phh.setCalcParams(rank, Tsim, Tcutoff, Nneur, Ncon*nw, recInt, h) |
89 | 109 |
|
90 | 110 | phh.setIncomSpikes(incTimes, nums, incSpWeights, NnumSp)
|
91 | 111 | phh.setNeurVars(Vm, Vrec, ns, ms, hs)
|
|
134 | 154 | # a2.set_xlim((0, SimTime/1000))
|
135 | 155 | #pl.show()
|
136 | 156 |
|
137 |
| -pl.savefig('N_{}_rate_{}_w_n_{}_Ie_{:.2f}_pcon_{:.2f}_delayRND.png'.format(N, rate[0], w_n, I0, pcon)) |
| 157 | +pl.savefig('N_{}_rate_{:.2f}_w_n_{:.3f}_Ie_{:.2f}_pcon_{:.2f}_delayRND.png'.format(N, rate[0], w_n, I0, pcon)) |
0 commit comments