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=0.5,
                 tau_syn_I=0.5,
                 tau_refrac=0.1,
                 i_offset=0.0,
                 v=-65.0,
                 exc_response=0.0,
                 exc_exp_response=0.0,
                 inh_response=0.0,
                 inh_exp_response=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)

        synapse_type = SynapseTypeAlpha(exc_response, exc_exp_response,
                                        tau_syn_E, inh_response,
                                        inh_exp_response, tau_syn_I)

        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(v_thresh)

        super(IFCurrAlpha, self).__init__(model_name="IF_curr_alpha",
                                          binary="IF_curr_alpha.aplx",
                                          neuron_model=neuron_model,
                                          input_type=input_type,
                                          synapse_type=synapse_type,
                                          threshold_type=threshold_type)
Example #2
0
    def __init__(self,
                 a=0.02,
                 b=0.2,
                 c=-65.0,
                 d=2.0,
                 i_offset=0.0,
                 u=-14.0,
                 v=-70.0,
                 tau_syn_E=5.0,
                 tau_syn_I=5.0,
                 isyn_exc=0.0,
                 isyn_inh=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelIzh(a, b, c, d, v, u, i_offset)
        synapse_type = SynapseTypeExponential(tau_syn_E, tau_syn_I, isyn_exc,
                                              isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(_IZK_THRESHOLD)

        super(IzkCurrExpBase, self).__init__(model_name="IZK_curr_exp",
                                             binary="IZK_curr_exp.aplx",
                                             neuron_model=neuron_model,
                                             input_type=input_type,
                                             synapse_type=synapse_type,
                                             threshold_type=threshold_type)
Example #3
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,
                 tau_ca2=50.0,
                 i_ca2=0.0,
                 i_alpha=0.1,
                 v=-65.0,
                 isyn_exc=0.0,
                 isyn_inh=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        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)
        additional_input_type = AdditionalInputCa2Adaptive(
            tau_ca2, i_ca2, i_alpha)

        super(IFCurrExpCa2Adaptive,
              self).__init__(model_name="IF_curr_exp_ca2_adaptive",
                             binary="IF_curr_exp_ca2_adaptive.aplx",
                             neuron_model=neuron_model,
                             input_type=input_type,
                             synapse_type=synapse_type,
                             threshold_type=threshold_type,
                             additional_input_type=additional_input_type)
Example #4
0
    def __init__(
            self, n_neurons,
            spikes_per_second=_apv_defs['spikes_per_second'],
            ring_buffer_sigma=_apv_defs['ring_buffer_sigma'],
            incoming_spike_buffer_size=_apv_defs['incoming_spike_buffer_size'],
            constraints=_apv_defs['constraints'],
            label=_apv_defs['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=initialize_parameters['u_init'],
            v_init=initialize_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']):
        # pylint: disable=too-many-arguments, too-many-locals
        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)

        super(IzkCurrExpBase, self).__init__(
            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 #5
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_E2=5.0,
                 tau_syn_I=5.0,
                 tau_refrac=0.1,
                 i_offset=0.0,
                 v=-65.0,
                 isyn_exc=0.0,
                 isyn_exc2=0.0,
                 isyn_inh=0.0,
                 multiplicator=0.0,
                 exc2_old=0.0,
                 scaling_factor=1.0):
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)
        synapse_type = SynapseTypeSEMD(tau_syn_E, tau_syn_E2, tau_syn_I,
                                       isyn_exc, isyn_exc2, isyn_inh,
                                       multiplicator, exc2_old, scaling_factor)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(v_thresh)

        super().__init__(model_name="IF_curr_exp_SEMD",
                         binary="IF_curr_exp_sEMD.aplx",
                         neuron_model=neuron_model,
                         input_type=input_type,
                         synapse_type=synapse_type,
                         threshold_type=threshold_type)
    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_E2=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,
                 isyn_exc2=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)
        synapse_type = SynapseTypeDualExponential(tau_syn_E, tau_syn_E2,
                                                  tau_syn_I, isyn_exc,
                                                  isyn_exc2, isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(v_thresh)

        super(IFCurrDualExpBase, self).__init__(model_name="IF_curr_dual_exp",
                                                binary="IF_curr_exp_dual.aplx",
                                                neuron_model=neuron_model,
                                                input_type=input_type,
                                                synapse_type=synapse_type,
                                                threshold_type=threshold_type)
    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'],

            # [default] Global model parameters
            damping_factor=None,  # required
            damping_sum=None,  # required

            # [default] Model parameters
            incoming_edges_count=None,  # required
            outgoing_edges_count=None,  # required

            # [none pynn] Initial values for the state variables
            rank_init=None,  # required
            curr_rank_acc_init=none_pynn_default_parameters[
                'curr_rank_acc_init'],
            curr_rank_count_init=none_pynn_default_parameters[
                'curr_rank_count_init'],
            iter_state_init=none_pynn_default_parameters['iter_state_init']):
        neuron_model = NeuronModelPageRank(
            n_neurons,
            damping_factor, damping_sum,
            incoming_edges_count, outgoing_edges_count,
            rank_init, curr_rank_acc_init, curr_rank_count_init, iter_state_init
        )

        input_type = InputTypeCurrent()  # Used as a NoOp
        synapse_type = SynapseTypeNoOp()
        threshold_type = ThresholdTypeNoOp()

        # instantiate sPyNNaker 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=PageRankBase._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,
            model_name="PageRank",  # name shown in reports
            binary="page_rank.aplx"  # C binary, defined in neuron/builds/<name>
        )
    def __init__(
            self,

            # neuron model parameters and state variables
            my_neuron_parameter=-70.0,
            i_offset=0.0,
            v=-70.0,

            # threshold types parameters
            v_thresh=-50.0,

            # synapse type parameters and state variables
            tau_syn_E=5.0,
            tau_syn_I=5.0,
            isyn_exc=0.0,
            isyn_inh=0.0,

            # additional input parameters and state variables
            my_additional_input_parameter=1.0,
            input_current=0.0):

        # create neuron model class
        neuron_model = MyNeuronModel(i_offset, my_neuron_parameter, v)

        # create synapse type model
        synapse_type = SynapseTypeExponential(tau_syn_E, tau_syn_I, isyn_exc,
                                              isyn_inh)

        # create input type model
        input_type = InputTypeCurrent()

        # create threshold type model
        threshold_type = ThresholdTypeStatic(v_thresh)

        # create additional inputs
        additional_input_type = MyAdditionalInput(
            my_additional_input_parameter, input_current)

        # Create the model using the superclass
        super(MyModelCurrExpMyAdditionalInput, self).__init__(

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

            # the matching binary name
            binary="my_model_curr_exp_my_additional_input.aplx",

            # the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input_type=additional_input_type)
    def __init__(
            self,
            n_neurons,
            spikes_per_second=_apv_defs['spikes_per_second'],
            ring_buffer_sigma=_apv_defs['ring_buffer_sigma'],
            incoming_spike_buffer_size=_apv_defs['incoming_spike_buffer_size'],
            constraints=_apv_defs['constraints'],
            label=_apv_defs['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_I=default_parameters['tau_syn_I'],
            tau_refrac=default_parameters['tau_refrac'],
            i_offset=default_parameters['i_offset'],
            tau_ca2=default_parameters["tau_ca2"],
            i_ca2=default_parameters["i_ca2"],
            i_alpha=default_parameters["i_alpha"],
            v_init=initialize_parameters['v_init'],
            isyn_exc=default_parameters['isyn_exc'],
            isyn_inh=default_parameters['isyn_inh']):
        # pylint: disable=too-many-arguments, too-many-locals
        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,
                                              initial_input_exc=isyn_exc,
                                              initial_input_inh=isyn_inh)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)
        additional_input = AdditionalInputCa2Adaptive(n_neurons, tau_ca2,
                                                      i_ca2, i_alpha)

        super(IFCurrExpCa2Adaptive, self).__init__(
            n_neurons=n_neurons,
            binary="IF_curr_exp_ca2_adaptive.aplx",
            label=label,
            max_atoms_per_core=self._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_exp_ca2_adaptive",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            additional_input=additional_input,
            constraints=constraints)
    def __init__(
            self,
            devices,
            create_edges,
            translator=None,

            # default params for the neuron model type
            tau_m=20.0,
            cm=1.0,
            v_rest=0.0,
            v_reset=0.0,
            tau_syn_E=5.0,
            tau_syn_I=5.0,
            tau_refrac=0.1,
            i_offset=0.0,
            v=0.0,
            isyn_inh=0.0,
            isyn_exc=0.0):
        """
        :param devices:\
            The AbstractMulticastControllableDevice instances to be controlled\
            by the population
        :param create_edges:\
            True if edges to the devices should be added by this device (set\
            to False if using the device over Ethernet using a translator)
        :param translator:\
            Translator to be used when used for Ethernet communication.  Must\
            be provided if the device is to be controlled over Ethernet.
        """
        # pylint: disable=too-many-arguments, too-many-locals

        if not devices:
            raise ConfigurationException("No devices specified")

        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_inh,
                                              isyn_exc)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeMulticastDeviceControl(devices)

        self._devices = devices
        self._translator = translator
        self._create_edges = create_edges

        super(ExternalDeviceLifControl,
              self).__init__(model_name="ExternalDeviceLifControl",
                             binary="external_device_lif_control.aplx",
                             neuron_model=neuron_model,
                             input_type=input_type,
                             synapse_type=synapse_type,
                             threshold_type=threshold_type)
Example #11
0
    def __init__(self, v_reset=0.0, v_thresh=1.0, v=0.0, isyn_exc=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelIntegrateAndFireConv(v, v_reset)
        synapse_type = SynapseTypeDeltaConv(isyn_exc)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStaticConv(v_thresh)

        super(NIFCurrExpConv, self).__init__(model_name="NIF_curr_exp_conv",
                                             binary="NIF_curr_exp_conv.aplx",
                                             neuron_model=neuron_model,
                                             input_type=input_type,
                                             synapse_type=synapse_type,
                                             threshold_type=threshold_type)
Example #12
0
    def __init__(
            self,
            n_neurons,
            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'],
            exc_response=non_pynn_default_parameters['exc_response'],
            exc_exp_response=non_pynn_default_parameters['exc_exp_response'],
            tau_syn_E=default_parameters['tau_syn_E'],
            inh_response=non_pynn_default_parameters['inh_response'],
            inh_exp_response=non_pynn_default_parameters['inh_exp_response'],
            tau_syn_I=default_parameters['tau_syn_I'],
            tau_refrac=default_parameters['tau_refrac'],
            i_offset=default_parameters['i_offset'],
            v_init=initialize_parameters['v_init']):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, v_init, v_rest, tau_m, cm, i_offset, v_reset,
            tau_refrac)

        synapse_type = SynapseTypeAlpha(n_neurons, exc_response,
                                        exc_exp_response, tau_syn_E,
                                        inh_response, inh_exp_response,
                                        tau_syn_I)

        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        super(IFCurrAlpha, self).__init__(
            n_neurons=n_neurons,
            binary="IF_curr_alpha.aplx",
            label=label,
            max_atoms_per_core=IFCurrAlpha._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_alpha",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
Example #13
0
    def __init__(
            self, tau_m=20.0, cm=1.0, v_rest=-65.0, v_reset=-65.0,
            v_thresh=-50.0, tau_refrac=0.1, i_offset=0.0, v=-65.0,
            isyn_exc=0.0, isyn_inh=0.0):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)
        synapse_type = SynapseTypeDelta(isyn_inh, isyn_exc)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(v_thresh)

        super(IFCurrDelta, self).__init__(
            model_name="IF_curr_delta", binary="IF_curr_delta.aplx",
            neuron_model=neuron_model, input_type=input_type,
            synapse_type=synapse_type, threshold_type=threshold_type)
    def __init__(
            self,

            # neuron model parameters and state variables
            my_neuron_parameter=-70.0,
            i_offset=0.0,
            v=-70.0,

            # threshold types parameters
            my_threshold_parameter=0.5,
            threshold_value=-10.0,

            # synapse type parameters
            tau_syn_E=5.0,
            tau_syn_I=5.0,
            isyn_exc=0.0,
            isyn_inh=0.0):

        # create neuron model class
        neuron_model = MyNeuronModel(i_offset, my_neuron_parameter, v)

        # create synapse type model
        synapse_type = SynapseTypeExponential(tau_syn_E, tau_syn_I, isyn_exc,
                                              isyn_inh)

        # create input type model
        input_type = InputTypeCurrent()

        # create threshold type model
        threshold_type = MyThresholdType(threshold_value,
                                         my_threshold_parameter)

        # Create the model using the superclass
        super(MyModelCurrExpMyThreshold, self).__init__(

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

            # the matching binary name
            binary="my_model_curr_exp_my_threshold.aplx",

            # the various model types
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type)
Example #15
0
    def __init__(self,
                 n_neurons,
                 spikes_per_second=AbstractPopulationVertex.
                 non_pynn_default_parameters['spikes_per_second'],
                 ring_buffer_sigma=AbstractPopulationVertex.
                 non_pynn_default_parameters['ring_buffer_sigma'],
                 incoming_spike_buffer_size=AbstractPopulationVertex.
                 non_pynn_default_parameters['incoming_spike_buffer_size'],
                 constraints=AbstractPopulationVertex.
                 non_pynn_default_parameters['constraints'],
                 label=AbstractPopulationVertex.
                 non_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_refrac=default_parameters['tau_refrac'],
                 i_offset=default_parameters['i_offset'],
                 v_init=initialize_parameters['v_init'],
                 isyn_exc=default_parameters['isyn_exc'],
                 isyn_inh=default_parameters['isyn_inh']):
        # pylint: disable=too-many-arguments, too-many-locals
        neuron_model = NeuronModelLeakyIntegrateAndFire(
            n_neurons, v_init, v_rest, tau_m, cm, i_offset, v_reset,
            tau_refrac)
        synapse_type = SynapseTypeDelta(n_neurons=n_neurons,
                                        initial_input_inh=isyn_inh,
                                        initial_input_exc=isyn_exc)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeStatic(n_neurons, v_thresh)

        super(IFCurrDelta, self).__init__(
            n_neurons=n_neurons,
            binary="IF_curr_delta.aplx",
            label=label,
            max_atoms_per_core=IFCurrDelta._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_delta",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
Example #16
0
    def __init__(
            self,

            # neuron model parameters and state variables
            my_neuron_parameter=-70.0,
            i_offset=0.0,
            v=-70.0,

            # threshold types parameters
            v_thresh=-50.0,

            # synapse type parameters and state variables
            my_ex_synapse_parameter=0.1,
            my_in_synapse_parameter=0.1,
            my_exc_init=0.0,
            my_inh_init=0.0):

        # create neuron model class
        neuron_model = MyNeuronModel(i_offset, my_neuron_parameter, v)

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

        # create input type model
        input_type = InputTypeCurrent()

        # create threshold type model
        threshold_type = ThresholdTypeStatic(v_thresh)

        # instantiate the sPyNNaker system by initialising
        # the AbstractPopulationVertex
        super(MyModelCurrMySynapseType, self).__init__(

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

            # the matching binary name
            binary="my_model_curr_my_synapse_type.aplx",

            # the various model types
            neuron_model=neuron_model, input_type=input_type,
            synapse_type=synapse_type, threshold_type=threshold_type)
    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_I=default_parameters['tau_syn_I'],
            tau_refrac=default_parameters['tau_refrac'],
            i_offset=default_parameters['i_offset'],
            v_init=none_pynn_default_parameters['v_init'],
            isyn_exc=default_parameters['isyn_exc'],
            isyn_inh=default_parameters['isyn_inh']):

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

        AbstractPopulationVertex.__init__(
            self, n_neurons=n_neurons, binary="IF_curr_exp_supervision.aplx", label=label,
            max_atoms_per_core=IFCurrExpSupervision._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_exp_supervision", neuron_model=neuron_model,
            input_type=input_type, synapse_type=synapse_type,
            threshold_type=threshold_type, constraints=constraints)
    def __init__(
            self,
            n_neurons,
            spikes_per_second=AbstractPopulationVertex.
        non_pynn_default_parameters['spikes_per_second'],
            ring_buffer_sigma=AbstractPopulationVertex.
        non_pynn_default_parameters['ring_buffer_sigma'],
            incoming_spike_buffer_size=AbstractPopulationVertex.
        non_pynn_default_parameters['incoming_spike_buffer_size'],
            constraints=AbstractPopulationVertex.
        non_pynn_default_parameters['constraints'],
            label=AbstractPopulationVertex.
        non_pynn_default_parameters['label'],

            # 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'],
            my_exc_init=default_parameters['my_exc_init'],
            my_inh_init=default_parameters['my_inh_init'],

            # state variables
            v_init=initialize_parameters['v_init']):

        # 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, my_exc_init,
                                     my_inh_init)

        # 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=(
                MyModelCurrMySynapseTypeBase._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 #19
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'],
            v_rest=default_parameters['v_rest'],
            decay=default_parameters['decay'],

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

            # synapse type parameters
            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'],

            # additional input parameter
            my_additional_input_parameter=(
                default_parameters['my_additional_input_parameter']),

            # state variables
            v_init=None):

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

        # create synapse type model
        synapse_type = SynapseTypeExponential(
            n_neurons, tau_syn_E, tau_syn_I, isyn_exc, isyn_inh)

        # create input type model
        input_type = InputTypeCurrent()

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

        # create additional inputs
        additional_input = MyAdditionalInput(
            n_neurons, my_additional_input_parameter)

        # 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=(
                MyModelCurrExpMyAdditionalInputBase.
                _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="MyModelCurrExpMyAdditionalInput",

            # the matching binary name
            binary="my_model_curr_exp_my_additional_input.aplx")
Example #20
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'],

            # Global model parameters
            damping_factor=default_parameters['damping_factor'],
            damping_sum=default_parameters['damping_sum'],

            # Model parameters
            incoming_edges_count=default_parameters['incoming_edges_count'],
            outgoing_edges_count=default_parameters['outgoing_edges_count'],

            # Threshold types parameters

            # Initial values for the state variables; this is not technically done in PyNN
        rank_init=none_pynn_default_parameters['rank_init'],
            curr_rank_acc_init=none_pynn_default_parameters[
                'curr_rank_acc_init'],
            curr_rank_count_init=none_pynn_default_parameters[
                'curr_rank_count_init'],
            iter_state_init=none_pynn_default_parameters['iter_state_init']):

        neuron_model = NeuronModelPageRank(n_neurons, damping_factor,
                                           damping_sum, incoming_edges_count,
                                           outgoing_edges_count, rank_init,
                                           curr_rank_acc_init,
                                           curr_rank_count_init,
                                           iter_state_init)

        input_type = InputTypeCurrent()

        synapse_type = SynapseTypeNoOp()

        threshold_type = ThresholdTypeNoOp()

        # 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=PageRankBase._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=None,
            model_name="PageRank",  # name shown in reports
            binary="page_rank.aplx")  # c src binary name
Example #21
0
    def __init__(
            self,
            n_neurons,
            devices,
            create_edges,
            translator=None,

            # standard neuron stuff
            spikes_per_second=_apv_defs['spikes_per_second'],
            label=_apv_defs['label'],
            ring_buffer_sigma=_apv_defs['ring_buffer_sigma'],
            incoming_spike_buffer_size=_apv_defs['incoming_spike_buffer_size'],
            constraints=_apv_defs['constraints'],

            # default params for the neuron model type
            tau_m=default_parameters['tau_m'],
            cm=default_parameters['cm'],
            v_rest=default_parameters['v_rest'],
            v_reset=default_parameters['v_reset'],
            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=initialize_parameters['v_init'],
            isyn_inh=default_parameters['isyn_inh'],
            isyn_exc=default_parameters['isyn_exc']):
        """
        :param n_neurons: The number of neurons in the population
        :param devices:\
            The AbstractMulticastControllableDevice instances to be controlled\
            by the population
        :param create_edges:\
            True if edges to the devices should be added by this dev (set\
            to False if using the dev over Ethernet using a translator)
        :param translator:\
            Translator to be used when used for Ethernet communication.  Must\
            be provided if the dev is to be controlled over Ethernet.
        """
        # pylint: disable=too-many-arguments, too-many-locals

        if not devices:
            raise ConfigurationException("No devices specified")

        # Verify that there are the correct number of neurons
        if n_neurons != len(devices):
            raise ConfigurationException(
                "The number of neurons must match the number of devices")

        # Create a partition to key map
        self._partition_id_to_key = OrderedDict(
            (str(dev.device_control_partition_id), dev.device_control_key)
            for dev in devices)

        # Create a partition to atom map
        self._partition_id_to_atom = {
            partition: i
            for (i, partition) in enumerate(self._partition_id_to_key.keys())
        }

        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,
                                              initial_input_inh=isyn_inh,
                                              initial_input_exc=isyn_exc)
        input_type = InputTypeCurrent()
        threshold_type = ThresholdTypeMulticastDeviceControl(devices)

        self._devices = devices
        self._message_translator = translator

        # Add the edges to the devices if required
        self._dependent_vertices = list()
        if create_edges:
            self._dependent_vertices = devices

        super(ExternalDeviceLifControl, self).__init__(
            n_neurons=n_neurons,
            binary="external_device_lif_control.aplx",
            label=label,
            max_atoms_per_core=(
                ExternalDeviceLifControl._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="ExternalDeviceLifControl",
            neuron_model=neuron_model,
            input_type=input_type,
            synapse_type=synapse_type,
            threshold_type=threshold_type,
            constraints=constraints)
    def __init__(
            self,
            n_neurons,
            spikes_per_second=AbstractPopulationVertex.
        non_pynn_default_parameters['spikes_per_second'],
            ring_buffer_sigma=AbstractPopulationVertex.
        non_pynn_default_parameters['ring_buffer_sigma'],
            incoming_spike_buffer_size=AbstractPopulationVertex.
        non_pynn_default_parameters['incoming_spike_buffer_size'],
            constraints=AbstractPopulationVertex.
        non_pynn_default_parameters['constraints'],
            label=AbstractPopulationVertex.
        non_pynn_default_parameters['label'],

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

            # threshold types parameters
            threshold_value=default_parameters['threshold_value'],
            prob_fire=default_parameters['prob_fire'],
            seed=default_parameters['seed'],

            # synapse type parameters
            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'],

            # state variables
            v_init=None):

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

        # create synapse type model
        synapse_type = SynapseTypeExponential(n_neurons, tau_syn_E, tau_syn_I,
                                              isyn_exc, isyn_inh)

        # create input type model
        input_type = InputTypeCurrent()

        # create threshold type model
        threshold_type = MyThresholdType(n_neurons, threshold_value, prob_fire,
                                         seed)

        # 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=(
                MyModelCurrExpMyThresholdBase._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="MyModelCurrExpMyThreshold",

            # the matching binary name
            binary="my_model_curr_exp_my_threshold.aplx")
Example #23
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'],
            isyn_exc=default_parameters['isyn_exc'],
            isyn_inh=default_parameters['isyn_inh'],

            # 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, isyn_exc, isyn_inh)

        # 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")