예제 #1
0
    def test_neuron_bayesian(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.bayesian.enable, False)
        neuron.bayesian.enable = True
        self.assertEqual(neuron.bayesian.enable, True)

        self.assertEqual(neuron.bayesian.connect_fire_vertical, False)
        neuron.bayesian.connect_fire_vertical = True
        self.assertEqual(neuron.bayesian.connect_fire_vertical, True)

        self.assertEqual(neuron.bayesian.connect_fire_to_right, False)
        neuron.bayesian.connect_fire_to_right = True
        self.assertEqual(neuron.bayesian.connect_fire_to_right, True)

        self.assertEqual(neuron.bayesian.connect_fire_from_right, False)
        neuron.bayesian.connect_fire_from_right = True
        self.assertEqual(neuron.bayesian.connect_fire_from_right, True)

        self.assertEqual(neuron.bayesian.enable_master, True)
        neuron.bayesian.enable_master = False
        self.assertEqual(neuron.bayesian.enable_master, False)

        self.assertEqual(neuron.bayesian.enable_slave, False)
        neuron.bayesian.enable_slave = True
        self.assertEqual(neuron.bayesian.enable_slave, True)

        self.assertEqual(neuron.bayesian.enable_0, False)
        neuron.bayesian.enable_0 = True
        self.assertEqual(neuron.bayesian.enable_0, True)

        self.assertEqual(neuron.bayesian.enable_1, False)
        neuron.bayesian.enable_1 = True
        self.assertEqual(neuron.bayesian.enable_1, True)
예제 #2
0
    def test_neuron_multicompartment(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.multicompartment.connect_soma, False)
        neuron.multicompartment.connect_soma = True
        self.assertEqual(neuron.multicompartment.connect_soma, True)

        self.assertEqual(neuron.multicompartment.connect_soma_right, False)
        neuron.multicompartment.connect_soma_right = True
        self.assertEqual(neuron.multicompartment.connect_soma_right, True)

        self.assertEqual(neuron.multicompartment.connect_right, False)
        neuron.multicompartment.connect_right = True
        self.assertEqual(neuron.multicompartment.connect_right, True)

        self.assertEqual(neuron.multicompartment.connect_vertical, False)
        neuron.multicompartment.connect_vertical = True
        self.assertEqual(neuron.multicompartment.connect_vertical, True)

        self.assertEqual(neuron.multicompartment.enable_conductance_division,
                         False)
        neuron.multicompartment.enable_conductance_division = True
        self.assertEqual(neuron.multicompartment.enable_conductance_division,
                         True)

        self.assertEqual(
            neuron.multicompartment.enable_conductance_multiplication, False)
        neuron.multicompartment.enable_conductance_multiplication = True
        self.assertEqual(
            neuron.multicompartment.enable_conductance_multiplication, True)
예제 #3
0
    def test_neuron_refractory_period(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.refractory_period.refractory_time,
                         neuron.RefractoryPeriod.RefractoryTime())
        value = random_ranged(
            lola.AtomicNeuron.RefractoryPeriod.RefractoryTime)
        neuron.refractory_period.refractory_time = value
        self.assertEqual(neuron.refractory_period.refractory_time, value)

        self.assertEqual(neuron.refractory_period.reset_holdoff,
                         neuron.RefractoryPeriod.ResetHoldoff())
        value = random_ranged(lola.AtomicNeuron.RefractoryPeriod.ResetHoldoff)
        neuron.refractory_period.reset_holdoff = value
        self.assertEqual(neuron.refractory_period.reset_holdoff, value)

        self.assertEqual(neuron.refractory_period.input_clock,
                         lola.AtomicNeuron.RefractoryPeriod.InputClock())
        value = random_ranged(lola.AtomicNeuron.RefractoryPeriod.InputClock)
        neuron.refractory_period.input_clock = value
        self.assertEqual(neuron.refractory_period.input_clock, value)

        self.assertEqual(neuron.refractory_period.enable_pause, False)
        neuron.refractory_period.enable_pause = True
        self.assertEqual(neuron.refractory_period.enable_pause, True)
예제 #4
0
    def test_neuron_event_routing(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.event_routing.analog_output,
                         neuron.event_routing.AnalogOutputMode.off)
        neuron.event_routing.analog_output = \
            neuron.event_routing.AnalogOutputMode.normal
        self.assertEqual(neuron.event_routing.analog_output,
                         neuron.event_routing.AnalogOutputMode.normal)
        neuron.event_routing.analog_output = \
            neuron.event_routing.AnalogOutputMode.strong
        self.assertEqual(neuron.event_routing.analog_output,
                         neuron.event_routing.AnalogOutputMode.strong)

        self.assertEqual(neuron.event_routing.enable_digital, False)
        neuron.event_routing.enable_digital = True
        self.assertEqual(neuron.event_routing.enable_digital, True)

        self.assertEqual(neuron.event_routing.enable_bypass_excitatory, False)
        neuron.event_routing.enable_bypass_excitatory = True
        self.assertEqual(neuron.event_routing.enable_bypass_excitatory, True)

        self.assertEqual(neuron.event_routing.enable_bypass_inhibitory, False)
        neuron.event_routing.enable_bypass_inhibitory = True
        self.assertEqual(neuron.event_routing.enable_bypass_inhibitory, True)

        self.assertEqual(neuron.event_routing.enable_post_overwrite, False)
        neuron.event_routing.enable_post_overwrite = True
        self.assertEqual(neuron.event_routing.enable_post_overwrite, True)

        self.assertEqual(neuron.event_routing.address, 0)
        value = random_ranged(lola.AtomicNeuron.EventRouting.Address)
        neuron.event_routing.address = value
        self.assertEqual(neuron.event_routing.address, value)
예제 #5
0
    def test_neuron_membrane(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.membrane_capacitance.capacitance, 0)
        value = random_ranged(
            lola.AtomicNeuron.MembraneCapacitance.CapacitorSize)
        neuron.membrane_capacitance.capacitance = value
        self.assertEqual(neuron.membrane_capacitance.capacitance, value)
예제 #6
0
    def test_neuron_threshold(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.threshold.v_threshold, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.threshold.v_threshold = value
        self.assertEqual(neuron.threshold.v_threshold, value)

        self.assertEqual(neuron.threshold.enable, False)
        neuron.threshold.enable = True
        self.assertEqual(neuron.threshold.enable, True)
예제 #7
0
    def test_neuron_exponential(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.exponential.enable, False)
        neuron.exponential.enable = True
        self.assertEqual(neuron.exponential.enable, True)

        self.assertEqual(neuron.exponential.v_exp, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.exponential.v_exp = value
        self.assertEqual(neuron.exponential.v_exp, value)

        self.assertEqual(neuron.exponential.i_bias, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.exponential.i_bias = value
        self.assertEqual(neuron.exponential.i_bias, value)
예제 #8
0
    def test_neuron_constant(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.constant_current.i_offset, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.constant_current.i_offset = value
        self.assertEqual(neuron.constant_current.i_offset, value)

        self.assertEqual(neuron.constant_current.enable, False)
        neuron.constant_current.enable = True
        self.assertEqual(neuron.constant_current.enable, True)

        self.assertEqual(neuron.constant_current.type,
                         neuron.constant_current.Type.source)
        neuron.constant_current.type = neuron.constant_current.Type.sink
        self.assertEqual(neuron.constant_current.type,
                         neuron.constant_current.Type.sink)
예제 #9
0
    def test_neuron_readout(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.readout.enable_buffered_access, False)
        neuron.readout.enable_buffered_access = True
        self.assertEqual(neuron.readout.enable_buffered_access, True)

        self.assertEqual(neuron.readout.enable_amplifier, False)
        neuron.readout.enable_amplifier = True
        self.assertEqual(neuron.readout.enable_amplifier, True)

        self.assertEqual(neuron.readout.enable_unbuffered_access, False)
        neuron.readout.enable_unbuffered_access = True
        self.assertEqual(neuron.readout.enable_unbuffered_access, True)

        self.assertEqual(neuron.readout.source, neuron.Readout.Source.membrane)
        value = lola.AtomicNeuron.Readout.Source.adaptation
        neuron.readout.source = value
        self.assertEqual(neuron.readout.source, value)
예제 #10
0
    def test_neuron_synaptic_input_inh(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.inhibitory_input.enable, False)
        neuron.inhibitory_input.enable = True
        self.assertEqual(neuron.inhibitory_input.enable, True)

        self.assertEqual(neuron.inhibitory_input.i_bias_tau, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.inhibitory_input.i_bias_tau = value
        self.assertEqual(neuron.inhibitory_input.i_bias_tau, value)

        self.assertEqual(neuron.inhibitory_input.i_bias_coba, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.inhibitory_input.i_bias_coba = value
        self.assertEqual(neuron.inhibitory_input.i_bias_coba, value)

        self.assertEqual(neuron.inhibitory_input.i_shift_reference, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.inhibitory_input.i_shift_reference = value
        self.assertEqual(neuron.inhibitory_input.i_shift_reference, value)

        self.assertEqual(neuron.inhibitory_input.i_bias_gm, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.inhibitory_input.i_bias_gm = value
        self.assertEqual(neuron.inhibitory_input.i_bias_gm, value)

        self.assertEqual(neuron.inhibitory_input.enable_small_capacitance,
                         True)
        neuron.inhibitory_input.enable_small_capacitance = False
        self.assertEqual(neuron.inhibitory_input.enable_small_capacitance,
                         False)

        self.assertEqual(neuron.inhibitory_input.enable_high_resistance, False)
        neuron.inhibitory_input.enable_high_resistance = True
        self.assertEqual(neuron.inhibitory_input.enable_high_resistance, True)

        self.assertEqual(neuron.inhibitory_input.enable_coba_mode, False)
        neuron.inhibitory_input.enable_coba_mode = True
        self.assertEqual(neuron.inhibitory_input.enable_coba_mode, True)
예제 #11
0
    def test_neuron_adaptation(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.adaptation.enable, False)
        neuron.adaptation.enable = True
        self.assertEqual(neuron.adaptation.enable, True)

        self.assertEqual(neuron.adaptation.invert_a, False)
        neuron.adaptation.invert_a = True
        self.assertEqual(neuron.adaptation.invert_a, True)

        self.assertEqual(neuron.adaptation.invert_b, False)
        neuron.adaptation.invert_b = True
        self.assertEqual(neuron.adaptation.invert_b, True)

        self.assertEqual(neuron.adaptation.v_ref, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.adaptation.v_ref = value
        self.assertEqual(neuron.adaptation.v_ref, value)

        self.assertEqual(neuron.adaptation.v_leak, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.adaptation.v_leak = value
        self.assertEqual(neuron.adaptation.v_leak, value)

        self.assertEqual(neuron.adaptation.i_bias_tau, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.adaptation.i_bias_tau = value
        self.assertEqual(neuron.adaptation.i_bias_tau, value)

        self.assertEqual(neuron.adaptation.i_bias_a, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.adaptation.i_bias_a = value
        self.assertEqual(neuron.adaptation.i_bias_a, value)

        self.assertEqual(neuron.adaptation.i_bias_b, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.adaptation.i_bias_b = value
        self.assertEqual(neuron.adaptation.i_bias_b, value)
예제 #12
0
    def test_neuron_reset(self):
        neuron = lola.AtomicNeuron()

        self.assertEqual(neuron.reset.v_reset, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.reset.v_reset = value
        self.assertEqual(neuron.reset.v_reset, value)

        self.assertEqual(neuron.reset.i_bias, 0)
        value = random_ranged(lola.AtomicNeuron.AnalogValue)
        neuron.reset.i_bias = value
        self.assertEqual(neuron.reset.i_bias, value)

        self.assertEqual(neuron.reset.enable_degeneration, False)
        neuron.reset.enable_degeneration = True
        self.assertEqual(neuron.reset.enable_degeneration, True)

        self.assertEqual(neuron.reset.enable_division, False)
        neuron.reset.enable_division = True
        self.assertEqual(neuron.reset.enable_division, True)

        self.assertEqual(neuron.reset.enable_multiplication, False)
        neuron.reset.enable_multiplication = True
        self.assertEqual(neuron.reset.enable_multiplication, True)