Пример #1
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'],

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

        # Add input type parameters for conductance
        e_rev_E=default_parameters['e_rev_E'],
        e_rev_I=default_parameters['e_rev_I'],

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

        # 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 = InputTypeConductance(n_neurons, e_rev_E, e_rev_I)

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

            # TODO: Set this to the matching binary name
            binary="my_model_cond_exp.aplx")
Пример #2
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")
    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'],
            v_rest=default_parameters['v_rest'],
            decay=default_parameters['decay'],

            # 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, v_rest,
                                     decay)

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