Example #1
0
def configure_scheduling():
    global SIMULATION_END_T
    sim.initialize()
    pynnn.setup()
    SIMULATION_END_T = 0
    RATE_ENC_RESPAWN_DICT.clear()
    POP_ADAPT_DICT.clear()
Example #2
0
def test_get_rate_encoder():
    re = get_rate_encoder(Tns.p1)
    assert get_rate_encoder(Tns.p1) == re
    assert get_rate_encoder(Tns.p2) != re
    from common.pynn_utils import POP_ADAPT_DICT as d
    assert (Tns.p1, RectilinearOutputRateEncoder) in d.keys()
    assert (Tns.p2, RectilinearOutputRateEncoder) in d.keys()
Example #3
0
def test_get_input_layer():
    p1i = get_input_layer(Tns.p1)
    assert get_input_layer(Tns.p1) == p1i
    assert get_input_layer(Tns.p2) != p1i
    from common.pynn_utils import POP_ADAPT_DICT as d
    assert (Tns.p1, RectilinearInputLayer) in d.keys()
    assert (Tns.p2, RectilinearInputLayer) in d.keys()
Example #4
0
def configure_scheduling():
    global SIMULATION_END_T
    sim.initialize()
    pynnn.setup()
    SIMULATION_END_T = 0
    RATE_ENC_RESPAWN_DICT.clear()
    POP_ADAPT_DICT.clear()
Example #5
0
def test_get_rate_encoder():
    re = get_rate_encoder(Tns.p1)
    assert get_rate_encoder(Tns.p1) == re
    assert get_rate_encoder(Tns.p2) != re
    from common.pynn_utils import POP_ADAPT_DICT as d

    assert (Tns.p1, RectilinearOutputRateEncoder) in d.keys()
    assert (Tns.p2, RectilinearOutputRateEncoder) in d.keys()
Example #6
0
def test_get_input_layer():
    p1i = get_input_layer(Tns.p1)
    assert get_input_layer(Tns.p1) == p1i
    assert get_input_layer(Tns.p2) != p1i
    from common.pynn_utils import POP_ADAPT_DICT as d

    assert (Tns.p1, RectilinearInputLayer) in d.keys()
    assert (Tns.p2, RectilinearInputLayer) in d.keys()