import sys import math import ctypes import neurongpu as ngpu from random import randrange import numpy as np order = 200 n_test = 100 expected_rate = 30.78 print("Building ...") ngpu.SetKernelStatus("rnd_seed", 1234) # seed for GPU random numbers n_receptors = 2 NE = 4 * order # number of excitatory neurons NI = 1 * order # number of inhibitory neurons n_neurons = NE + NI # number of neurons in total CE = 800 # number of excitatory synapses per neuron CI = CE//4 # number of inhibitory synapses per neuron Wex = 0.05 Win = 0.35 # poisson generator parameters poiss_rate = 20000.0 # poisson signal rate in Hz poiss_weight = 0.37 poiss_delay = 0.2 # poisson signal delay in ms
import sys import ctypes import neurongpu as ngpu from random import randrange if len(sys.argv) != 2: print("Usage: python %s n_neurons" % sys.argv[0]) quit() order = int(sys.argv[1]) // 5 ngpu.SetKernelStatus("time_resolution", 1.0) print("Building ...") ngpu.SetKernelStatus("rnd_seed", 1234) # seed for GPU random numbers n_receptors = 2 NE = 4 * order # number of excitatory neurons NI = 1 * order # number of inhibitory neurons n_neurons = NE + NI # number of neurons in total CE = 80 # number of excitatory synapses per neuron CI = CE // 4 # number of inhibitory synapses per neuron #fact=0.002 fact = 0.0055 Wex = 0.5 * fact Win = 3.5 * fact
import sys import neurongpu as ngpu import numpy as np tolerance = 0.0005 E_L = -65.0 ngpu.SetKernelStatus("verbosity_level", 0) neuron = ngpu.Create('iaf_psc_exp_hc', 1) spike = ngpu.Create("spike_generator") spike_times = [10.0, 400.0] n_spikes = 2 # set spike times and height ngpu.SetStatus(spike, {"spike_times": spike_times}) delay = [1.0, 100.0] weight = [1.0, -2.0] conn_spec = {"rule": "all_to_all"} syn_spec_ex = {'weight': weight[0], 'delay': delay[0]} syn_spec_in = {'weight': weight[1], 'delay': delay[1]} ngpu.Connect(spike, neuron, conn_spec, syn_spec_ex) ngpu.Connect(spike, neuron, conn_spec, syn_spec_in) record = ngpu.CreateRecord("", ["V_m_rel"], [neuron[0]], [0]) #voltmeter = nest.Create('voltmeter') #nest.Connect(voltmeter, neuron) ngpu.Simulate(800.0)