############################################################################ # Create population, provide noisy input to each cell, connect network ############################################################################ # create network object instance network = Network(dt=PSET.dt, tstop=PSET.tstop, v_init=PSET.v_init, celsius=PSET.celsius, OUTPUTPATH=PSET.OUTPUTPATH) # create populations iteratively for name, pop_args, rotation_args, POP_SIZE in zip( PSET.populationParameters['me_type'], PSET.populationParameters['pop_args'], PSET.populationParameters['rotation_args'], (PSET.populationParameters['POP_SIZE']).astype(int)): network.create_population(CWD=PSET.CWD, CELLPATH=PSET.CELLPATH, Cell=NetworkCell, POP_SIZE=POP_SIZE, name=name, cell_args=PSET.cellParameters[name], pop_args=pop_args, rotation_args=rotation_args) # tic-toc if RANK == 0: create_population_time = time() - tic print('Populations initialized in {} seconds'.format(create_population_time)) logfile.write('population {}\n'.format(create_population_time)) tic = time() # Sync MPI threads as populations may take a different amount of # time across RANKs. All neurons must have been created before connections # are made COMM.Barrier()
if __name__ == '__main__': ############################################################################ # Main simulation ############################################################################ # create directory for output: if not os.path.isdir(OUTPUTPATH): if RANK == 0: os.mkdir(OUTPUTPATH) COMM.Barrier() # 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 network object instance network = Network(dt=PSET.dt, tstop=PSET.tstop, v_init=PSET.v_init, celsius=PSET.celsius, OUTPUTPATH=PSET.OUTPUTPATH) # create populations iteratively for name, pop_args, rotation_args, POP_SIZE in zip( PSET.populationParameters['me_type'], PSET.populationParameters['pop_args'], PSET.populationParameters['rotation_args'], (PSET.populationParameters['POP_SIZE']).astype(int)): network.create_population(CWD=PSET.CWD, CELLPATH=PSET.CELLPATH, Cell=NetworkCell, POP_SIZE=POP_SIZE, name=name, cell_args=PSET.cellParameters[name], pop_args=pop_args, rotation_args=rotation_args) # tic-toc if RANK == 0: create_population_time = time() - tic print('Populations initialized in {} seconds'.format( create_population_time)) logfile.write('population {}\n'.format(create_population_time)) tic = time() # Sync MPI threads as populations may take a different amount of # time across RANKs. All neurons must have been created before connections # are made
if __name__ == '__main__': ############################################################################ # Main simulation ############################################################################ # create directory for output: if not os.path.isdir(OUTPUTPATH): if RANK == 0: os.mkdir(OUTPUTPATH) COMM.Barrier() # 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):