コード例 #1
0
tau_decay = [20.0]

ngpu.SetStatus(ngpu_neuron, {
    "E_rev": E_rev,
    "tau_decay": tau_decay,
    "tau_rise": tau_rise
})

nest_neuron = nest.Create("aeif_cond_beta_multisynapse")
nest.SetStatus(nest_neuron, {
    "E_rev": E_rev,
    "tau_decay": tau_decay,
    "tau_rise": tau_rise
})

neuron_image = ngpu_nest.CreateNeuronImage(nest_neuron, 2)

poiss_gen = ngpu.Create("poisson_generator")
ngpu.SetStatus(poiss_gen, "rate", 12000.0)

parrot = ngpu.Create("parrot_neuron")
ngpu.SetStatus(parrot, {'hold_spike_height': 1})

conn_dict = {"rule": "one_to_one"}
syn_dict_pg = {"weight": 1.0, "delay": 1.0}
ngpu.Connect(poiss_gen, parrot, conn_dict, syn_dict_pg)

syn_dict = {"weight": 0.05, "delay": 2.0, "receptor": 0}
syn_dict1 = {"weight": 0.05, "delay": 2.0, "receptor": 1}

ngpu.Connect(parrot, ngpu_neuron, conn_dict, syn_dict)
コード例 #2
0
import ngpu_nest
import numpy as np

neuron = ngpu.Create('aeif_cond_beta', 1, 4)
ngpu.SetStatus(neuron, {"V_peak": 0.0, "a": 4.0, "b": 80.5})
ngpu.SetStatus(
    neuron, {
        'E_rev': [0.0, 0.0, 0.0, -85.0],
        'tau_decay': [50.0, 20.0, 20.0, 20.0],
        'tau_rise': [10.0, 10.0, 1.0, 1.0]
    })

spike = nest.Create('spike_generator',
                    params={'spike_times': np.array([10.0])})

spike_image = ngpu_nest.CreateNeuronImage(spike, 1)

delay = [1.0, 300.0, 500.0, 700.0]
w = [1.0, 1.0, 1.0, 1.0]
conn_spec = {"rule": "all_to_all"}
for syn in range(4):
    syn_spec = {'receptor': syn, 'weight': w[syn], 'delay': delay[syn]}
    ngpu.Connect(spike_image, neuron, conn_spec, syn_spec)

record = ngpu.CreateRecord("", ["V_m"], [neuron[0]], [0])

nest.Simulate(1000.0)

data_list = ngpu.GetRecordData(record)
t = [row[0] for row in data_list]
V_m = [row[1] for row in data_list]
コード例 #3
0
import neurongpu as ngpu
import nest
import ngpu_nest

nest_neuron = nest.Create("aeif_cond_alpha", 5)
node_image = ngpu_nest.CreateNeuronImage(nest_neuron, 1)

nest.SetStatus(nest_neuron, {"I_e": 800.0})

spike_det = ngpu.Create("spike_detector", 5)
conn_dict = {"rule": "one_to_one"}
syn_dict = {"weight": 1.0, "delay": 1.0}
ngpu.Connect(node_image, spike_det, conn_dict, syn_dict)

record_n = ngpu.CreateRecord("", ["spike"], [node_image[0]], [0])

record_sd = ngpu.CreateRecord("", ["spike_height"], [spike_det[0]], [0])

multimeter = nest.Create("multimeter")
multimeter.set(record_from=["V_m"])
nest.Connect(multimeter, nest_neuron)

nest_neuron2 = nest.Create("aeif_cond_alpha", 1)
node_image2 = ngpu_nest.CreateNeuronImage(nest_neuron2, 1)

spike = ngpu.Create("spike_generator")
spike_times = [50.0, 100.0, 400.0, 600.0]
n_spikes = 4

# set spike times and heights
ngpu.SetStatus(spike, {"spike_times": spike_times})