Beispiel #1
0
def test_synapse_by_ampa1_vec_with_uniform_delay():
    lif = StochasticLIF(2)
    ampa = AMPA1_vec(pre=lif, post=lif, conn=bp.connect.All2All(), delay=10.)

    driver = NumbaCUDANodeDriver(pop=ampa)
    driver.get_steps_func(show_code=True)
    pprint(driver.formatted_funcs)
Beispiel #2
0
def test_stochastic_lif_monitors1():

    for place in ['cpu', 'cuda']:
        set_monitor_done_in(place)
        lif = StochasticLIF(1, monitors=['V', 'input', 'spike'])
        driver = NumbaCUDANodeDriver(pop=lif)
        driver.get_monitor_func(mon_length=100, show_code=True)
        pprint(driver.formatted_funcs)
        print()
        print()
def test_stochastic_lif_inputs_of_fix1():
    lif = StochasticLIF(1)
    driver = NumbaCUDANodeDriver(pop=lif)

    # data format of int / float
    for op in ['=', '+', '-', '*', '/']:
        print(f'op : {op}')
        driver.get_input_func(formatted_inputs=[('input', 1., op, 'fix')],
                              show_code=True)
        pprint(driver.formatted_funcs)
        print()
        print()
Beispiel #4
0
def test_neuron_by_lif():
    lif = StochasticLIF(1, has_noise=False)

    driver = NumbaCUDANodeDriver(pop=lif)
    driver.get_steps_func(show_code=True)
    pprint(driver.formatted_funcs)