Example #1
0
    def __init__(self,
                 tau_m=20.0,
                 cm=1.0,
                 v_rest=-65.0,
                 v_reset=-65.0,
                 v_thresh=-50.0,
                 tau_syn_E=5.0,
                 tau_syn_I=5.0,
                 tau_refrac=0.1,
                 i_offset=0.0,
                 v=-65.0,
                 isyn_exc=0.0,
                 isyn_inh=0.0):
        # pylint: disable=protected-access

        # add to the path the location of the dodgy binary
        # (if_cur_exp with the c_main bodged to result in it
        # running for twice as long as expected)
        ex_finder = AbstractSpiNNakerCommon._EXECUTABLE_FINDER
        ex_finder.add_path(os.path.dirname(__file__))

        neuron_model = NeuronModelLeakyIntegrateAndFire(
            v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)
        synapse_type = SynapseTypeExponential(tau_syn_E, tau_syn_I, isyn_exc,
                                              isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(v_thresh)

        super(FakeIFCurrExp, self).__init__(model_name="Fake_IF_curr_exp",
                                            binary=BINARY,
                                            neuron_model=neuron_model,
                                            input_type=input_type,
                                            synapse_type=synapse_type,
                                            threshold_type=threshold_type)
Example #2
0
    def __init__(
            self, n_neurons, machine_time_step, timescale_factor,
            spikes_per_second=None, ring_buffer_sigma=None, constraints=None,
            label=None,
            tau_m=default_parameters['tau_m'], cm=default_parameters['cm'],
            v_rest=default_parameters['v_rest'],
            v_reset=default_parameters['v_reset'],
            v_thresh=default_parameters['v_thresh'],
            tau_syn_E=default_parameters['tau_syn_E'],
            tau_syn_I=default_parameters['tau_syn_I'],
            tau_refrac=default_parameters['tau_refrac'],
            i_offset=default_parameters['i_offset'], v_init=None):

        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, machine_time_step, v_init, v_rest, tau_m, cm, i_offset,
            v_reset, tau_refrac)
        synapse_type = SynapseTypeExponential(
            n_neurons, machine_time_step, tau_syn_E, tau_syn_I)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        AbstractPopulationVertex.__init__(
            self, n_neurons=n_neurons, binary="IF_curr_exp.aplx", label=label,
            max_atoms_per_core=FakeIFCurrExp._model_based_max_atoms_per_core,
            machine_time_step=machine_time_step,
            timescale_factor=timescale_factor,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            model_name="IF_curr_exp", neuron_model=neuron_model,
            input_type=input_type, synapse_type=synapse_type,
            threshold_type=threshold_type, constraints=constraints)
    def __init__(self,
                 n_neurons,
                 machine_time_step,
                 timescale_factor,
                 spikes_per_second=None,
                 ring_buffer_sigma=None,
                 incoming_spike_buffer_size=None,
                 constraints=None,
                 label=None,
                 tau_m=default_parameters['tau_m'],
                 cm=default_parameters['cm'],
                 v_rest=default_parameters['v_rest'],
                 v_reset=default_parameters['v_reset'],
                 v_thresh=default_parameters['v_thresh'],
                 tau_syn_E=default_parameters['tau_syn_E'],
                 tau_syn_I=default_parameters['tau_syn_I'],
                 tau_refrac=default_parameters['tau_refrac'],
                 i_offset=default_parameters['i_offset'],
                 v_init=None):

        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, machine_time_step, v_init, v_rest, tau_m, cm, i_offset,
            v_reset, tau_refrac)
        synapse_type = ExpSupervision(n_neurons, machine_time_step, tau_syn_E,
                                      tau_syn_I)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        # create additional inputs
        additional_input = None

        # instantiate the sPyNNaker system by initialising
        #  the AbstractPopulationVertex
        AbstractPopulationVertex.__init__(

            # standard inputs, do not need to change.
            self,
            n_neurons=n_neurons,
            label=label,
            machine_time_step=machine_time_step,
            timescale_factor=timescale_factor,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            max_atoms_per_core=(
                IFCurrExpSupervision._model_based_max_atoms_per_core),

            # the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input=additional_input,

            # the model a name (shown in reports)
            model_name="IFCurrExpSupervision",

            # the matching binary name
            binary="if_curr_exp_supervision.aplx")
    def __init__(self,
                 n_neurons,
                 spikes_per_second=AbstractPopulationVertex.
                 none_pynn_default_parameters['spikes_per_second'],
                 ring_buffer_sigma=AbstractPopulationVertex.
                 none_pynn_default_parameters['ring_buffer_sigma'],
                 incoming_spike_buffer_size=AbstractPopulationVertex.
                 none_pynn_default_parameters['incoming_spike_buffer_size'],
                 constraints=AbstractPopulationVertex.
                 none_pynn_default_parameters['constraints'],
                 label=AbstractPopulationVertex.
                 none_pynn_default_parameters['label'],
                 tau_m=default_parameters['tau_m'],
                 cm=default_parameters['cm'],
                 v_rest=default_parameters['v_rest'],
                 v_reset=default_parameters['v_reset'],
                 v_thresh=default_parameters['v_thresh'],
                 tau_syn_E=default_parameters['tau_syn_E'],
                 tau_syn_E2=default_parameters['tau_syn_E2'],
                 tau_syn_I=default_parameters['tau_syn_I'],
                 tau_refrac=default_parameters['tau_refrac'],
                 i_offset=default_parameters['i_offset'],
                 v_init=None,
                 isyn_exc=default_parameters['isyn_exc'],
                 isyn_inh=default_parameters['isyn_inh'],
                 isyn2_exc=default_parameters['isyn2_exc']):

        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, v_init, v_rest, tau_m, cm, i_offset, v_reset,
            tau_refrac)
        synapse_type = SynapseTypeDualExponential(n_neurons, tau_syn_E,
                                                  tau_syn_E2, tau_syn_I,
                                                  isyn_exc, isyn2_exc,
                                                  isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        AbstractPopulationVertex.__init__(
            self,
            n_neurons=n_neurons,
            binary="IF_curr_exp_dual.aplx",
            label=label,
            max_atoms_per_core=IFCurrDualExpBase.
            _model_based_max_atoms_per_core,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            model_name="IF_curr_dual_exp",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
Example #5
0
    def __init__(self,
                 n_neurons,
                 spikes_per_second=AbstractPopulationVertex.
                 none_pynn_default_parameters['spikes_per_second'],
                 ring_buffer_sigma=AbstractPopulationVertex.
                 none_pynn_default_parameters['ring_buffer_sigma'],
                 incoming_spike_buffer_size=AbstractPopulationVertex.
                 none_pynn_default_parameters['incoming_spike_buffer_size'],
                 constraints=AbstractPopulationVertex.
                 none_pynn_default_parameters['constraints'],
                 label=AbstractPopulationVertex.
                 none_pynn_default_parameters['label'],
                 a=default_parameters['a'],
                 b=default_parameters['b'],
                 c=default_parameters['c'],
                 d=default_parameters['d'],
                 i_offset=default_parameters['i_offset'],
                 u_init=default_parameters['u_init'],
                 v_init=default_parameters['v_init'],
                 tau_syn_E=default_parameters['tau_syn_E'],
                 tau_syn_I=default_parameters['tau_syn_I'],
                 isyn_exc=default_parameters['isyn_exc'],
                 isyn_inh=default_parameters['isyn_inh']):

        neuron_model = NeuronModelIzh(n_neurons, a, b, c, d, v_init, u_init,
                                      i_offset)
        synapse_type = SynapseTypeExponential(n_neurons, tau_syn_E, tau_syn_I,
                                              isyn_exc, isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, _IZK_THRESHOLD)

        AbstractPopulationVertex.__init__(
            self,
            n_neurons=n_neurons,
            binary="IZK_curr_exp.aplx",
            label=label,
            max_atoms_per_core=IzkCurrExpBase._model_based_max_atoms_per_core,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            model_name="IZK_curr_exp",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
Example #6
0
    def __init__(self,
                 n_neurons,
                 spikes_per_second=None,
                 ring_buffer_sigma=None,
                 constraints=None,
                 label=None,
                 tau_m=default_parameters['tau_m'],
                 cm=default_parameters['cm'],
                 v_rest=default_parameters['v_rest'],
                 v_reset=default_parameters['v_reset'],
                 v_thresh=default_parameters['v_thresh'],
                 tau_syn_E=default_parameters['tau_syn_E'],
                 tau_syn_I=default_parameters['tau_syn_I'],
                 tau_refrac=default_parameters['tau_refrac'],
                 i_offset=default_parameters['i_offset'],
                 v_init=None):
        # pylint: disable=protected-access

        # add to the path the location of the dodgy binary
        # (if_cur_exp with the c_main bodged to result in it
        # running for twice as long as expected)
        ex_finder = AbstractSpiNNakerCommon._EXECUTABLE_FINDER
        ex_finder.add_path(os.path.dirname(__file__))

        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, v_init, v_rest, tau_m, cm, i_offset, v_reset,
            tau_refrac)
        synapse_type = SynapseTypeExponential(n_neurons, tau_syn_E, tau_syn_I)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        super(FakeIFCurrExp, self).__init__(
            n_neurons=n_neurons,
            binary=BINARY,
            label=label,
            max_atoms_per_core=FakeIFCurrExp._model_based_max_atoms_per_core,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            model_name="Fake_IF_curr_exp",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints,
            incoming_spike_buffer_size=None)
Example #7
0
    def __init__(self,
                 n_neurons,
                 machine_time_step,
                 timescale_factor,
                 spikes_per_second=None,
                 ring_buffer_sigma=None,
                 incoming_spike_buffer_size=None,
                 constraints=None,
                 label=None,
                 a=default_parameters['a'],
                 b=default_parameters['b'],
                 c=default_parameters['c'],
                 d=default_parameters['d'],
                 i_offset=default_parameters['i_offset'],
                 u_init=default_parameters['u_init'],
                 v_init=default_parameters['v_init'],
                 tau_syn_E=default_parameters['tau_syn_E'],
                 tau_syn_I=default_parameters['tau_syn_I']):

        neuron_model = NeuronModelIzh(n_neurons, machine_time_step, a, b, c, d,
                                      v_init, u_init, i_offset)
        synapse_type = SynapseTypeExponential(n_neurons, machine_time_step,
                                              tau_syn_E, tau_syn_I)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, _IZK_THRESHOLD)

        AbstractPopulationVertex.__init__(
            self,
            n_neurons=n_neurons,
            binary="IZK_curr_exp.aplx",
            label=label,
            max_atoms_per_core=IzkCurrExp._model_based_max_atoms_per_core,
            machine_time_step=machine_time_step,
            timescale_factor=timescale_factor,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            model_name="IZK_curr_exp",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
Example #8
0
    def __init__(
            self,
            n_neurons,
            spikes_per_second=None,
            ring_buffer_sigma=None,
            incoming_spike_buffer_size=None,
            constraints=None,
            label=None,

            # neuron model parameters
            my_parameter=default_parameters['my_parameter'],
            i_offset=default_parameters['i_offset'],

            # threshold types parameters
            v_thresh=default_parameters['v_thresh'],

            # synapse type parameters
            my_ex_synapse_parameter=default_parameters[
                'my_ex_synapse_parameter'],
            my_in_synapse_parameter=default_parameters[
                'my_in_synapse_parameter'],

            # state variables
            v_init=None):

        # create neuron model class
        neuron_model = MyNeuronModel(n_neurons, i_offset, my_parameter)

        # create synapse type model
        synapse_type = MySynapseType(n_neurons, my_ex_synapse_parameter,
                                     my_in_synapse_parameter)

        # create input type model
        input_type = InputTypeCurrent()

        # create threshold type model
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        # create additional inputs
        additional_input = None

        # instantiate the sPyNNaker system by initialising
        #  the AbstractPopulationVertex
        AbstractPopulationVertex.__init__(

            # standard inputs, do not need to change.
            self,
            n_neurons=n_neurons,
            label=label,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,
            max_atoms_per_core=(
                MyModelCurrMySynapseType._model_based_max_atoms_per_core),

            # the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input=additional_input,

            # the model a name (shown in reports)
            model_name="MyModelMySynapseType",

            # the matching binary name
            binary="my_model_curr_my_synapse_type.aplx")
Example #9
0
    def __init__(
        self,
        n_neurons,
        spikes_per_second=None,
        ring_buffer_sigma=None,
        incoming_spike_buffer_size=None,
        constraints=None,
        label=None,

        # TODO: neuron model parameters (add / remove as required)
        # neuron model parameters
        my_parameter=default_parameters['my_parameter'],
        i_offset=default_parameters['i_offset'],

        # TODO: threshold types parameters (add / remove as required)
        # threshold types parameters
        v_thresh=default_parameters['v_thresh'],

        # TODO: synapse type parameters (add /remove as required)
        # synapse type parameters
        tau_syn_E=default_parameters['tau_syn_E'],
        tau_syn_I=default_parameters['tau_syn_I'],

        # TODO: Optionally, you can add initial values for the state
        # variables; this is not technically done in PyNN
        v_init=None):

        # TODO: create your neuron model class (change if required)
        # create your neuron model class
        neuron_model = MyNeuronModel(n_neurons, i_offset, my_parameter)

        # TODO: create your synapse type model class (change if required)
        # create your synapse type model
        synapse_type = SynapseTypeExponential(n_neurons, tau_syn_E, tau_syn_I)

        # TODO: create your input type model class (change if required)
        # create your input type model
        input_type = InputTypeCurrent()

        # TODO: create your threshold type model class (change if required)
        # create your threshold type model
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        # TODO: create your own additional inputs (change if required).
        # create your own additional inputs
        additional_input = None

        # instantiate the sPyNNaker system by initialising
        #  the AbstractPopulationVertex
        AbstractPopulationVertex.__init__(

            # standard inputs, do not need to change.
            self,
            n_neurons=n_neurons,
            label=label,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,

            # TODO: Ensure the correct class is used below
            max_atoms_per_core=MyModelCurrExp._model_based_max_atoms_per_core,

            # These are the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input=additional_input,

            # TODO: Give the model a name (shown in reports)
            model_name="MyModelCurrExp",

            # TODO: Set this to the matching binary name
            binary="my_model_curr_exp.aplx")
Example #10
0
    def __init__(
            self,
            n_neurons,
            machine_time_step,
            timescale_factor,
            spikes_per_second=None,
            ring_buffer_sigma=None,
            incoming_spike_buffer_size=None,
            constraints=None,
            label=None,

            # neuron model parameters
            primary=default_parameters['primary'],

            # threshold types parameters
            v_thresh=default_parameters['v_thresh'],

            # initial values for the state values
            v_init=None,
            receive_port=None,
            receive_tag=None,
            board_address=None):

        # create your neuron model class
        neuron_model = SpindleModel(n_neurons, machine_time_step, primary)

        # create your synapse type model
        synapse_type = FusimotorActivation(
            n_neurons, machine_time_step,
            MuscleSpindle.default_parameters['a_syn_D'],
            MuscleSpindle.default_parameters['tau_syn_D'],
            MuscleSpindle.default_parameters['a_syn_S'],
            MuscleSpindle.default_parameters['tau_syn_S'])

        # create your input type model
        input_type = InputTypeCurrent()

        # create your threshold type model
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        # create your own additional inputs
        additional_input = None

        # instantiate the sPyNNaker system by initialising
        #  the AbstractPopulationVertex
        AbstractPopulationVertex.__init__(

            # standard inputs, do not need to change.
            self,
            n_neurons=n_neurons,
            label=label,
            machine_time_step=machine_time_step,
            timescale_factor=timescale_factor,
            spikes_per_second=spikes_per_second,
            ring_buffer_sigma=ring_buffer_sigma,
            incoming_spike_buffer_size=incoming_spike_buffer_size,

            # max units per core
            max_atoms_per_core=MuscleSpindle._model_based_max_atoms_per_core,

            # These are the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input=additional_input,

            # model name (shown in reports)
            model_name="MuscleSpindle",

            # matching binary name
            binary="muscle_spindle.aplx")

        ReceiveBuffersToHostBasicImpl.__init__(self)

        self.add_constraint(
            TagAllocatorRequireReverseIptagConstraint(
                receive_port,
                constants.SDP_PORTS.INPUT_BUFFERING_SDP_PORT.value,
                board_address, receive_tag))