# instantiate Network: network = Network(**networkParameters) # create E and I populations: for name, size in zip(population_names, population_sizes): network.create_population(name=name, POP_SIZE=size, **populationParameters) # create excitatory background synaptic activity for each cell # with Poisson statistics for cell in network.populations[name].cells: idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64) for i in idx: syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn', weight=0.002, **dict(tau1=0.2, tau2=1.8, e=0.)) syn.set_spike_times_w_netstim(interval=100., seed=np.random.rand() * 2**32 - 1 ) # create connectivity matrices and connect populations: for i, pre in enumerate(population_names): for j, post in enumerate(population_names): # boolean connectivity matrix between pre- and post-synaptic neurons # in each population (postsynaptic on this RANK) connectivity = network.get_connectivity_rand( pre=pre, post=post, connprob=connectionProbability[i][j] )
# create excitatpry background synaptic activity for each cell # with Poisson statistics k = 0 for cell in network.populations[name].cells: #rotation = {'x' : np.random.uniform(0,2*np.pi), 'y' : np.random.uniform(0,2*np.pi)} #cell.set_rotation(**rotation) #i = cell.get_rand_idx_area_norm(section='allsec', nidx=64) noise = 0.1 t1 = 0.2 t2 = 5.0 if 20 > k >= 0: syn = Synapse(cell=cell, idx=0, syntype='Exp2Syn', weight=0.006, **dict(tau1=t1, tau2=t2, e=0.)) syn.set_spike_times_w_netstim(interval=10., noise=noise, start=200., number=35) elif 40 > k >= 20: syn = Synapse(cell=cell, idx=0, syntype='Exp2Syn', weight=0.006, **dict(tau1=t1, tau2=t2, e=0.)) syn.set_spike_times_w_netstim(interval=10., noise=noise, start=220.,
if RANK == 0: print(ii, name, size) network.create_population(name=name, POP_SIZE=size, **populationParameters[ii]) #initial train and all spikes if name == 'E': #Receiving cell is excitatory for j, cell in enumerate(network.populations[name].cells): if j % 4 == 0: weighttrain = np.random.normal(0.05, 0.02) idx = cell.get_rand_idx_area_norm(section='dend', nidx=1) for i in idx: syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn', weight=weighttrain, **dict(synapseParameters[0][0])) syn.set_spike_times(np.array([distr_t[j]])) for i in range(len(syns[0])): #E:E og ei if syns[0][i][0] == j: #ii første? pre_gid = syns[0][i][1] ind = SPIKES['gids'][0].index(pre_gid) #i her? tim = SPIKES['times'][0][ind] if tim.size > 0: # print("EE", tim) x = syns[0][i][2] y = syns[0][i][3] z = syns[0][i][4] idx = cell.get_closest_idx(x, y, z)
network = Network(**networkParameters) # create populations for name, size in zip(population_names, population_sizes): network.create_population(name=name, POP_SIZE=size, **populationParameters) # create some background synaptic activity onto the cells with Poisson # activation statistics for cell in network.populations[name].cells: idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64) for i in idx: syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn', weight=0.002, **dict(tau1=0.2, tau2=1.8, e=0.)) syn.set_spike_times_w_netstim(interval=1000. / 5.) # create connectivity and connect populations for i, pre in enumerate(population_names): for j, post in enumerate(population_names): # boolean connectivity matrix between pre- and post-synaptic neurons # in each population (postsynaptic on this RANK) connectivity = network.get_connectivity_rand( pre=pre, post=post, connprob=connectionProbability) # connect network (conncount, syncount) = network.connect( pre=pre,
for ii, (name, size) in enumerate(zip(population_names, population_sizes)): if RANK == 0: print(ii, name, size) network.create_population(name=name, POP_SIZE=size, **populationParameters[ii]) # initial spike train if name == 'E': for j, cell in enumerate(network.populations[name].cells): if j % 4 == 0: idx = cell.get_rand_idx_area_norm(section='dend', nidx=1) for i in idx: #if more than one synapse syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn', weight=weighttrain, **dict(synapseParameters[0][0])) syn.set_spike_times(np.array([distr_t[j]])) # create connectivity matrices and connect populations: for i, pre in enumerate(population_names): for j, post in enumerate(population_names): # boolean connectivity matrix between pre- and post-synaptic neurons # in each population (postsynaptic on this RANK) connectivity = network.get_connectivity_rand( pre=pre, post=post, connprob=connectionProbability[i][j]) print(np.shape(connectivity)) # connect network: (conncount, syncount) = network.connect(
# instantiate Network: network = Network(**networkParameters) # create E and I populations: for name, size in zip(population_names, population_sizes): network.create_population(name=name, POP_SIZE=size, **populationParameters) # create excitatpry background synaptic activity for each cell # with Poisson statistics for cell in network.populations[name].cells: idx = cell.get_rand_idx_area_norm(section='allsec', nidx=64) for i in idx: syn = Synapse(cell=cell, idx=i, syntype='Exp2Syn', weight=0.002, **dict(tau1=0.2, tau2=1.8, e=0.)) syn.set_spike_times_w_netstim(interval=200.) # create connectivity matrices and connect populations: for i, pre in enumerate(population_names): for j, post in enumerate(population_names): # boolean connectivity matrix between pre- and post-synaptic neurons # in each population (postsynaptic on this RANK) connectivity = network.get_connectivity_rand( pre=pre, post=post, connprob=connectionProbability[i][j] ) # connect network: