config.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import itertools
  2. # number of neurons
  3. N = 1000
  4. # fraction of excitatory cells
  5. f = 0.8
  6. # exc. strength (postsynaptic amplitude in mV)
  7. mu = 0.1
  8. # connection probability
  9. epsilon = 0.1
  10. # external rate relative to threshold rate
  11. eta = 0.9
  12. # variance of weight sample distributions
  13. syndist = 'lognormal' # 'truncated-normal' 'lognormal' 'normal'
  14. sigma_ex = 0.12
  15. sigma_in = 0.1
  16. # simulation time
  17. simtime = 61000 #ms
  18. ###### rewiring parameters ######
  19. shuffle_source = ['E', 'I']
  20. shuffle_target = ['E', 'I']
  21. shuffle_frac = [1.0, 3500]
  22. add_source = 'E'
  23. add_target = 'E'
  24. add_source_frac = [0.2, 12800]
  25. add_target_frac = [0.1, 0.2, 0.4, 0.6, 0.8, 1.0]
  26. ###### derived & fixed network parameters ######
  27. J_ex = mu
  28. # enforce global balance state
  29. J_in = -f * J_ex / (1-f)
  30. dt = 0.1 # the resolution in ms
  31. delay = [.5, 3] #1.5 # min/max synaptic delays in ms (uniform)
  32. NE = int(f * N) # number of excitatory neurons
  33. NI = N - NE # number of inhibitory neurons
  34. in_connection_rule = 'pairwise_bernoulli'
  35. ex_connection_rule = 'pairwise_bernoulli'
  36. synapse_model = 'static_synapse'
  37. neuron_model = 'iaf_psc_delta'
  38. tauMem = 20.0 # time constant of membrane potential in ms
  39. theta = 20.0 # membrane threshold potential in mV
  40. neuron_params = {"C_m": 1.0,
  41. "tau_m": tauMem,
  42. "t_ref": 2.0,
  43. "E_L": 0.0,
  44. "V_reset": 0.0,
  45. "V_m": 0.0,
  46. "V_th": theta}
  47. # Driving stiumulus parameters
  48. stimulus = "poisson_generator"
  49. parrot_input = False
  50. CE = epsilon * NE # estimated number of excitatory synapses per neuron
  51. CI = epsilon * NI # estimated number of inhibitory synapses per neuron
  52. if J_ex:
  53. nu_th = theta / (J_ex * CE * tauMem)
  54. else:
  55. nu_th = theta / (CE * tauMem)
  56. nu_ex = eta * nu_th
  57. p_rate = 1000.0 * nu_ex * CE
  58. p_rate_func = lambda eta: 1000 * eta*nu_th * CE
  59. ###### non-network parameters ######
  60. # cut swinging-in time
  61. cut_inital_time = 1000 #ms
  62. # bin size for correlation calculation
  63. bin_size = 2 #ms
  64. # derived number of bins
  65. bin_num = int((simtime - cut_inital_time) / bin_size)
  66. # seeds for multiple runs with same specification
  67. seed = list(range(1,101))
  68. seed_pairs = [f'{i[0]}-{i[1]}' for i in itertools.combinations(seed,2)]