config.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. # type of distribution for synaptic weights
  13. syndist = 'lognormal' # 'truncated-normal' 'lognormal' 'normal'
  14. # variance of weight sample distributions
  15. sigma_ex = 0.12
  16. sigma_in = 0.1
  17. # simulation time
  18. simtime = 61000 #ms
  19. ###### rewiring parameters ######
  20. shuffle_source = ['E', 'I']
  21. shuffle_target = ['E', 'I']
  22. shuffle_frac = 1.0
  23. add_source = 'E'
  24. add_target = 'E'
  25. add_source_frac = [0.2, 10000]
  26. # add_target_frac > p/(1-p) * add_source_frac
  27. add_target_frac = [0.02, 0.05, 0.1, 0.2, 0.4, 0.6, 0.8, 1.0]
  28. cluster_pop = 'E'
  29. cluster_number = 3
  30. cluster_size = [0.02, 0.04, 0.06, 0.08]
  31. cluster_epsilon = [0.2, 0.3, 0.4, 0.5, 0.6]
  32. hub_pop = 'E'
  33. hub_size = [0.04, 0.06, 0.08, 0.10]
  34. hub_strength = [0.2, 0.3, 0.4, 0.5]
  35. hub_epsilon = 0.5
  36. chain_pop = 'E'
  37. chain_size = [0.05, 0.10, 0.15, 0.20]
  38. chain_strength = [0.3, 0.4, 0.5, 0.6]
  39. chain_epsilon = 0.6
  40. chain_length = 3
  41. connectors = [0, 30]
  42. ###### derived & fixed network parameters ######
  43. J_ex = mu
  44. # enforce global balance state
  45. J_in = -f * J_ex / (1-f)
  46. dt = 0.1 # the resolution in ms
  47. delay = [.5, 3] #1.5 # min/max synaptic delays in ms (uniform)
  48. NE = int(f * N) # number of excitatory neurons
  49. NI = N - NE # number of inhibitory neurons
  50. in_connection_rule = 'pairwise_bernoulli'
  51. ex_connection_rule = 'pairwise_bernoulli'
  52. synapse_model = 'static_synapse'
  53. neuron_model = 'iaf_psc_delta'
  54. tauMem = 20.0 # time constant of membrane potential in ms
  55. theta = 20.0 # membrane threshold potential in mV
  56. neuron_params = {"C_m": 1.0,
  57. "tau_m": tauMem,
  58. "t_ref": 2.0,
  59. "E_L": 0.0,
  60. "V_reset": 0.0,
  61. "V_m": 0.0,
  62. "V_th": theta}
  63. # Driving stiumulus parameters
  64. stimulus = "poisson_generator"
  65. parrot_input = False
  66. CE = epsilon * NE # estimated number of excitatory synapses per neuron
  67. CI = epsilon * NI # estimated number of inhibitory synapses per neuron
  68. if J_ex:
  69. nu_th = theta / (J_ex * CE * tauMem)
  70. else:
  71. nu_th = theta / (CE * tauMem)
  72. nu_ex = eta * nu_th
  73. p_rate = 1000.0 * nu_ex * CE
  74. p_rate_func = lambda eta: 1000 * eta*nu_th * CE
  75. ###### non-network parameters ######
  76. # cut swinging-in time
  77. cut_inital_time = 1000 #ms
  78. # bin size for correlation calculation
  79. bin_size = 2 #ms
  80. # derived number of bins
  81. bin_num = int((simtime - cut_inital_time) / bin_size)
  82. # seeds for multiple runs with same specification
  83. seed = list(range(1,101))
  84. seed_pairs = [f'{i[0]}-{i[1]}' for i in itertools.combinations(seed,2)]