# plasticity wdep_grcpcsynapsis = p.AdditiveWeightDependence(w_min=0.0, w_max=0.5, A_plus=0.0015, A_minus=0.0018) tdep_grcpcsynapsis = p.SpikePairRuleSinAdd(tau_minus=50., tau_plus=50., delay=100.0, nearest=False) # delay 70-100 stdp_grcpcsynapsis = p.STDPMechanism(timing_dependence=tdep_grcpcsynapsis, weight_dependence=wdep_grcpcsynapsis, voltage_dependence=None) syndyn_grcpcsynapsis = p.SynapseDynamics(slow=stdp_grcpcsynapsis) rng = p.NumpyRNG() grcpc_weights_distribution = p.RandomDistribution('uniform', [0.05, 0.5], rng) pro_grcpcsynapsis_connector = p.FixedProbabilityConnector( 0.8, weights=grcpc_weights_distribution) pro_grcpcsynapsis_left = p.Projection(prepop, postpop, pro_grcpcsynapsis_connector, target="excitatory", synapse_dynamics=syndyn_grcpcsynapsis, label="grcpcsynapsis") proj = pro_grcpcsynapsis_left proj.projection_edge.postvertex.custom_max_atoms_per_core = max( 1, 4000 / proj.projection_edge.prevertex.atoms) #plasticsyn.projection_edge.postvertex.custom_max_atoms_per_core = 100
""" #!/usr/bin/python import pyNN.spiNNaker as p import numpy, pylab p.setup(timestep=1.0, min_delay=1.0, max_delay=8.0, db_name='synfire.sqlite') n_pop = 16 # number of populations nNeurons = 10 # number of neurons in each population p.get_db().set_number_of_neurons_per_core( 'IF_curr_exp', nNeurons) # this will set one population per core # random distributions rng = p.NumpyRNG(seed=28374) delay_distr = p.RandomDistribution('uniform', [1, 10], rng=rng) weight_distr = p.RandomDistribution('uniform', [0, 2], rng=rng) v_distr = p.RandomDistribution('uniform', [-55, -95], rng) cell_params_lif_in = { 'tau_m': 32, 'v_init': -80, 'v_rest': -75, 'v_reset': -95, 'v_thresh': -55, 'tau_syn_E': 5, 'tau_syn_I': 10, 'tau_refrac': 100, 'i_offset': 1 }
stimI_pop = sim.Population(num_inh, sim.SpikeSourceArray, {'spike_times': inh_stim_times}, label="inh network stimulation") stdp_model = sim.STDPMechanism( timing_dependence=sim.SpikePairRule(tau_plus=tau_plus, tau_minus=tau_minus, nearest=True), weight_dependence=sim.AdditiveWeightDependence(w_min=min_weight, w_max=max_weight, A_plus=a_plus, A_minus=a_minus)) rng = sim.NumpyRNG(seed=int(time.time())) #rng = sim.NumpyRNG(seed=1) e2e_lst, e2i_lst, i2e_lst, i2i_lst = connections(max_conn_per_neuron, num_exc, num_inh, max_delay) e2e_conn = sim.FromListConnector(e2e_lst) e2i_conn = sim.FromListConnector(e2i_lst) i2e_conn = sim.FromListConnector(i2e_lst) i2i_conn = sim.FromListConnector(i2i_lst) o2o_conn = sim.OneToOneConnector(weights=weight_to_spike, delays=1.) #~ print("-----------------------------------------------------------------") #~ print("-----------------------------------------------------------------") #~ print("Excitatory to Excitatory connections")
'i_offset': izk_types[inv_cell_type]['I'], #'tau_syn_E': 2, #'tau_syn_I': 2, } inj_cell_params = { 'port': 12345, } inj_cell_type = ExternalDevices.SpikeInjector #~ num_inh = int(num_neurons*(1./4.)) rngseed = int(time.time()) #rngseed = 1 rng = sim.NumpyRNG(seed=rngseed) neuron_model = sim.IZK_curr_exp sim.set_number_of_neurons_per_core(neuron_model, 128) sim.setup(timestep=timestep, min_delay = min_delay, max_delay = max_delay) ############ stdp stdp_model = sim.STDPMechanism( timing_dependence=sim.SpikePairRule(tau_plus=20., tau_minus=20.0, nearest=True), weight_dependence=sim.AdditiveWeightDependence(w_min=0.01, w_max=6., A_plus=0.02, A_minus=0.02) ) ############ random dist objects
""" import pyNN.spiNNaker as p import numpy, pylab p.setup(timestep=1.0, min_delay=1.0, max_delay=8.0, db_name='synfire.sqlite') n_pop = 64 nNeurons = 10 p.get_db().set_number_of_neurons_per_core( 'IZK_curr_exp', nNeurons) # this will set one population per core #p.get_db().set_number_of_neurons_per_core('IF_curr_exp', 2*nNeurons) # this will set 2 populations per core #p.get_db().set_number_of_neurons_per_core('IF_curr_exp', nNeurons/2) # this will set 1 population every 2 cores rng = p.NumpyRNG(seed=28374) rng1 = p.NumpyRNG(seed=12345) delay_distr = p.RandomDistribution('uniform', [1, 5], rng) weight_distr = p.RandomDistribution('uniform', [0, 2], rng1) v_distr = p.RandomDistribution('uniform', [-85, -95], rng) v_inits = [] for i in range(nNeurons): v_inits.append(v_distr.next()) RS_params = { 'a': 0.02, 'b': 0.2, 'c': -70,