本文整理汇总了Python中pyNN.hardware.brainscales.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_SpikeSourceArray
def test_SpikeSourceArray(self):
spike_times = [50.0]
p = sim.Population(3, sim.SpikeSourceArray(spike_times=spike_times))
p2 = sim.Population(3, sim.Hardware_IF_cond_exp())
syn = sim.StaticSynapse(weight=0.012)
con = sim.Projection(p, p2, connector=sim.OneToOneConnector(), synapse_type=syn, receptor_type="excitatory")
spike_times_g = p.get("spike_times")
p2.record("v")
sim.run(100.0)
weights = nan_to_num(con.get("weight", format="array"))
print weights
data = p2.get_data().segments[0]
vm = data.filter(name="v")[0]
print vm
Figure(
Panel(
weights, data_labels=["ext->cell"], line_properties=[{"xticks": True, "yticks": True, "cmap": "Greys"}]
),
Panel(
vm,
ylabel="Membrane potential (mV)",
data_labels=["excitatory", "excitatory"],
line_properties=[{"xticks": True, "yticks": True}],
),
).save("result")
示例2: test_print_v
def test_print_v(self):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_v()
sim.run(10.0)
a.write_data = Mock()
a.print_v("foo.txt")
a.write_data.assert_called_with('foo.txt', 'v', True)
示例3: test_get_gsyn
def test_get_gsyn(self):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record_gsyn()
sim.run(10.0)
a.get_data = Mock()
a.get_gsyn()
a.get_data.assert_called_with(['gsyn_exc', 'gsyn_inh'], True)
示例4: test_getSpikes
def test_getSpikes(self):
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record('spikes')
sim.run(10.0)
a.get_data = Mock()
a.getSpikes()
a.get_data.assert_called_with('spikes', True)
示例5: test_printSpikes
def test_printSpikes(self):
# TODO: implement assert_deprecated
p1 = sim.Population(11, sim.IF_cond_exp())
p2 = sim.Population(11, sim.IF_cond_exp())
a = sim.Assembly(p1, p2, label="test")
a.record('spikes')
sim.run(10.0)
a.write_data = Mock()
a.printSpikes("foo.txt")
a.write_data.assert_called_with('foo.txt', 'spikes', True)
示例6: test_restart_loop
def test_restart_loop():
extra = {"loglevel": 0, "useSystemSim": True, "hardware": sim.hardwareSetup["one-hicann"]}
sim.setup(**extra)
sim.end()
sim.setup(**extra)
sim.end()
sim.setup(**extra)
sim.run(10.0)
sim.end()
sim.setup(**extra)
sim.run(10.0)
sim.end()
示例7: test_restart_loop
def test_restart_loop():
if not have_hardware_brainscales:
raise SkipTest
extra = {'loglevel':0, 'useSystemSim': True, 'hardware': sim.hardwareSetup['one-hicann']}
sim.setup(**extra)
sim.end()
sim.setup(**extra)
sim.end()
sim.setup(**extra)
sim.run(10.0)
sim.end()
sim.setup(**extra)
sim.run(10.0)
sim.end()
#def test_several_runs():
if not have_hardware_brainscales:
raise SkipTest
示例8: test_SpikeSourceArray
def test_SpikeSourceArray(self):
from pyNN.utility.plotting import Figure, Panel
spike_times = [50.]
p = sim.Population(3, sim.SpikeSourceArray(spike_times=spike_times))
p2 = sim.Population(3, sim.Hardware_IF_cond_exp())
syn = sim.StaticSynapse(weight=0.012)
con = sim.Projection(p, p2, connector = sim.OneToOneConnector(), synapse_type=syn,receptor_type='excitatory')
spike_times_g = p.get('spike_times')
p2.record('v')
sim.run(100.0)
weights = nan_to_num(con.get('weight', format="array"))
print weights
data = p2.get_data().segments[0]
vm = data.filter(name="v")[0]
print vm
Figure(
Panel(weights,data_labels=["ext->cell"], line_properties=[{'xticks':True, 'yticks':True, 'cmap':'Greys'}]),
Panel(vm, ylabel="Membrane potential (mV)", data_labels=["excitatory", "excitatory"], line_properties=[{'xticks': True, 'yticks':True}]),
).save("result")
示例9: test_run
def test_run(self):
sim.setup(**extra)
self.assertEqual(sim.run(100.0), 100.0)
示例10: test_mean_spike_count
def test_mean_spike_count(self):
p = sim.Population(14, sim.EIF_cond_exp_isfa_ista())
pv = p[2::3]
pv.record('spikes')
sim.run(100.0)
self.assertEqual(p.mean_spike_count(), 2.0)
示例11: test_reset
def test_reset(self):
sim.setup(**extra)
sim.run(100.0)
sim.reset()
self.assertEqual(sim.get_current_time(), 0.0)