Beispiel #1
0
    def get_neural_parameters(self):
        return [

            # membrane voltage [mV]
            # REAL     V_membrane;
            NeuronParameter(self._v_init, DataType.S1615),

            # membrane resting voltage [mV]
            # REAL     V_rest;
            NeuronParameter(self._v_rest, DataType.S1615),

            # membrane resistance [MOhm]
            # REAL     R_membrane;
            NeuronParameter(self._r_membrane, DataType.S1615),

            # 'fixed' computation parameter - time constant multiplier for
            # closed-form solution
            # exp( -(machine time step in ms)/(R * C) ) [.]
            # REAL     exp_TC;
            NeuronParameter(self._exp_tc, DataType.S1615),

            # offset current [nA]
            # REAL     I_offset;
            NeuronParameter(self._i_offset, DataType.S1615)
        ]
Beispiel #2
0
 def get_neural_parameters(self):
     # Note: this must match the order of the parameters in the neuron_t
     # data structure in the C code
     return [
         NeuronParameter(-1, DataType.INT32),
         NeuronParameter(self._primary, DataType.INT32)
     ]
Beispiel #3
0
    def get_neural_parameters(self, machine_time_step):
        return [

            # membrane voltage [mV]
            # REAL     V_membrane;
            NeuronParameter(self._v_init, _IF_TYPES.V_INIT.data_type),

            # membrane resting voltage [mV]
            # REAL     V_rest;
            NeuronParameter(self._v_rest, _IF_TYPES.V_REST.data_type),

            # membrane resistance [MOhm]
            # REAL     R_membrane;
            NeuronParameter(self._r_membrane, _IF_TYPES.R_MEMBRANE.data_type),

            # 'fixed' computation parameter - time constant multiplier for
            # closed-form solution
            # exp( -(machine time step in ms)/(R * C) ) [.]
            # REAL     exp_TC;
            NeuronParameter(self._exp_tc(machine_time_step),
                            _IF_TYPES.EXP_TC.data_type),

            # offset current [nA]
            # REAL     I_offset;
            NeuronParameter(self._i_offset, _IF_TYPES.I_OFFSET.data_type)
        ]
Beispiel #4
0
 def get_input_type_parameters(self):
     return [
         NeuronParameter(self._e_rev_E,
                         _CONDUCTANTCE_TYPES.E_REV_E.data_type),
         NeuronParameter(self._e_rev_I,
                         _CONDUCTANTCE_TYPES.E_REV_I.data_type)
     ]
Beispiel #5
0
    def get_synapse_type_parameters(self):

        # TODO: update to return the parameters
        # Note: The order of the parameters must match the order in the
        # synapse_param_t data structure in the C code
        return [
            NeuronParameter(self._my_ex_synapse_parameter, DataType.S1615),
            NeuronParameter(self._my_in_synapse_parameter, DataType.S1615),
        ]
Beispiel #6
0
    def get_threshold_parameters(self):

        # TODO: update to the return the parameters
        # Note: The order of the parameters must match the order in the
        # threshold_type_t data structure in the C code
        return [
            NeuronParameter(self._threshold_value, DataType.S1615),
            NeuronParameter(self._my_threshold_parameter, DataType.S1615)
        ]
    def get_synapse_type_parameters(self):
        d_decay, d_init = get_exponential_decay_and_init(
            self._a_syn_D, self._tau_syn_D, self._machine_time_step)
        s_decay, s_init = get_exponential_decay_and_init(
            self._a_syn_S, self._tau_syn_S, self._machine_time_step)

        return [
            NeuronParameter(d_decay, DataType.S1615),
            NeuronParameter(d_init, DataType.S1615),
            NeuronParameter(s_decay, DataType.S1615),
            NeuronParameter(s_init, DataType.S1615)
        ]
Beispiel #8
0
    def get_synapse_type_parameters(self):
        e_decay, e_init = get_exponential_decay_and_init(
            self._tau_syn_E, self._machine_time_step)
        i_decay, i_init = get_exponential_decay_and_init(
            self._tau_syn_I, self._machine_time_step)

        return [
            NeuronParameter(e_decay, DataType.UINT32),
            NeuronParameter(e_init, DataType.UINT32),
            NeuronParameter(i_decay, DataType.UINT32),
            NeuronParameter(i_init, DataType.UINT32)
        ]
Beispiel #9
0
    def get_neural_parameters(self):
        return [

            # REAL A
            NeuronParameter(self._a, DataType.S1615),

            # REAL B
            NeuronParameter(self._b, DataType.S1615),

            # REAL C
            NeuronParameter(self._c, DataType.S1615),

            # REAL D
            NeuronParameter(self._d, DataType.S1615),

            # REAL V
            NeuronParameter(self._v_init, DataType.S1615),

            # REAL U
            NeuronParameter(self._u_init, DataType.S1615),

            # offset current [nA]
            # REAL I_offset;
            NeuronParameter(self._i_offset, DataType.S1615),

            # current timestep - simple correction for threshold
            # REAL this_h;
            NeuronParameter(self._machine_time_step / 1000.0, DataType.S1615)
        ]
Beispiel #10
0
    def get_parameters(self):
        """
        Generate Neuron Parameter data (region 2):
        """

        # Get the parameters:
        # typedef struct neuron_t {
        #
        # // nominally 'fixed' parameters
        #     REAL         A;
        #     REAL         B;
        #     REAL         C;
        #     REAL         D;
        #
        # // Variable-state parameters
        #     REAL         V;
        #     REAL         U;
        #
        # // offset current [nA]
        #     REAL         I_offset;
        #
        # // current timestep - simple correction for threshold in beta version
        #     REAL         this_h;
        # } neuron_t;
        return [
            NeuronParameter(self._a, DataType.S1615),
            NeuronParameter(self._b, DataType.S1615),
            NeuronParameter(self._c, DataType.S1615),
            NeuronParameter(self._d, DataType.S1615),
            NeuronParameter(self._v_init, DataType.S1615),
            NeuronParameter(self._u_init, DataType.S1615),
            NeuronParameter(self.ioffset, DataType.S1615),
            NeuronParameter(self._machine_time_step / 1000.0, DataType.S1615)
        ]
Beispiel #11
0
    def get_neural_parameters(self, machine_time_step):
        return [

            # REAL A
            NeuronParameter(self._a, _IZH_TYPES.A.data_type),

            # REAL B
            NeuronParameter(self._b, _IZH_TYPES.B.data_type),

            # REAL C
            NeuronParameter(self._c, _IZH_TYPES.C.data_type),

            # REAL D
            NeuronParameter(self._d, _IZH_TYPES.D.data_type),

            # REAL V
            NeuronParameter(self._v_init, _IZH_TYPES.V_INIT.data_type),

            # REAL U
            NeuronParameter(self._u_init, _IZH_TYPES.U_INIT.data_type),

            # offset current [nA]
            # REAL I_offset;
            NeuronParameter(self._i_offset, _IZH_TYPES.I_OFFSET.data_type),

            # current timestep - simple correction for threshold
            # REAL this_h;
            NeuronParameter(machine_time_step / 1000.0,
                            _IZH_TYPES.THIS_H.data_type)
        ]
    def get_synapse_type_parameters(self, machine_time_step):
        # pylint: disable=arguments-differ
        e_decay, _ = get_exponential_decay_and_init(
            self._data[TAU_SYN_E], machine_time_step)

        i_decay, _ = get_exponential_decay_and_init(
            self._data[TAU_SYN_I], machine_time_step)

        # pre-multiply constants (convert to millisecond)
        dt_divided_by_tau_syn_E_sqr = self._data[TAU_SYN_E].apply_operation(
            lambda x: (float(machine_time_step) / 1000.0) / (x * x))
        dt_divided_by_tau_syn_I_sqr = self._data[TAU_SYN_I].apply_operation(
            lambda x: (float(machine_time_step) / 1000.0) / (x * x))

        return [
            # linear term buffer
            NeuronParameter(self._data[EXC_RESPONSE],
                            _COMB_EXP_TYPES.RESPONSE_EXC.data_type),
            # exponential term buffer
            NeuronParameter(self._data[EXC_EXP_RESPONSE],
                            _COMB_EXP_TYPES.RESPONSE_EXC_EXP.data_type),
            # evolution parameters
            NeuronParameter(dt_divided_by_tau_syn_E_sqr,
                            _COMB_EXP_TYPES.CONST_EXC.data_type),
            NeuronParameter(e_decay, _COMB_EXP_TYPES.DECAY_EXC.data_type),

            NeuronParameter(self._data[INH_RESPONSE],
                            _COMB_EXP_TYPES.RESPONSE_INH.data_type),
            NeuronParameter(self._data[INH_EXP_RESPONSE],
                            _COMB_EXP_TYPES.RESPONSE_INH_EXP.data_type),
            NeuronParameter(dt_divided_by_tau_syn_I_sqr,
                            _COMB_EXP_TYPES.CONST_INH.data_type),
            NeuronParameter(i_decay, _COMB_EXP_TYPES.DECAY_INH.data_type),
        ]
    def get_parameters(self):
        """ Get the parameters for the additional input

        :return: An array of parameters
        :rtype: array of\
                :py:class:`spynnaker.pyNN.models.neural_properties.neural_parameter.NeuronParameter`
        """
        # TODO: update the parameters
        # Note: must match the order of the additional_input_t structure in
        # the C code
        return [
            NeuronParameter(0, DataType.S1615),
            NeuronParameter(self._my_additional_input_parameter,
                            DataType.S1615),
        ]
Beispiel #14
0
    def get_neural_parameters(self):

        # TODO: update to match the parameters and state variables
        # Note: this must match the order of the parameters in the neuron_t
        # data structure in the C code
        return [

            # REAL V;
            NeuronParameter(self._v_init, DataType.S1615),

            # REAL I_offset;
            NeuronParameter(self._i_offset, DataType.S1615),

            # REAL my_parameter;
            NeuronParameter(self._my_neuron_parameter, DataType.S1615)
        ]
Beispiel #15
0
    def get_neural_parameters(self):
        params = NeuronModelLeakyIntegrate.get_neural_parameters(self)
        params.extend([

            # countdown to end of next refractory period [timesteps]
            # int32_t  refract_timer;
            NeuronParameter(0, DataType.INT32),

            # post-spike reset membrane voltage [mV]
            # REAL     V_reset;
            NeuronParameter(self._v_reset, DataType.S1615),

            # refractory time of neuron [timesteps]
            # int32_t  T_refract;
            NeuronParameter(self._tau_refrac_timesteps, DataType.INT32)
        ])
        return params
Beispiel #16
0
    def get_parameters(self):
        """
        Generate Neuron Parameter data (region 2):
        """

        # Get the parameters
        return [

            # membrane voltage threshold at which neuron spikes [mV]
            # REAL     V_thresh;
            NeuronParameter(self._v_thresh, DataType.S1615),

            # post-spike reset membrane voltage [mV]
            # REAL     V_reset;
            NeuronParameter(self._v_reset, DataType.S1615),

            # membrane resting voltage [mV]
            # REAL     V_rest;
            NeuronParameter(self._v_rest, DataType.S1615),

            # membrane resistance
            # REAL     R_membrane;
            NeuronParameter(self._r_membrane, DataType.S1615),

            # membrane voltage [mV]
            # REAL     V_membrane;
            NeuronParameter(self._v_init, DataType.S1615),

            # offset current [nA]
            # REAL     I_offset;
            NeuronParameter(self.ioffset, DataType.S1615),

            # 'fixed' computation parameter - time constant multiplier for
            # closed-form solution
            # exp( -(machine time step in ms)/(R * C) ) [.]
            # REAL     exp_TC;
            NeuronParameter(self._exp_tc(self._machine_time_step),
                            DataType.S1615),

            # countdown to end of next refractory period [timesteps]
            # int32_t  refract_timer;
            NeuronParameter(self._refract_timer, DataType.INT32),

            # refractory time of neuron [timesteps]
            # int32_t  T_refract;
            NeuronParameter(
                self._tau_refract_timesteps(self._machine_time_step),
                DataType.INT32)
        ]
    def get_neural_parameters(self, machine_time_step):
        params = NeuronModelLeakyIntegrate.get_neural_parameters(self)
        params.extend([

            # count down to end of next refractory period [timesteps]
            # int32_t  refract_timer;
            NeuronParameter(self._countdown_to_refactory_period,
                            _LIF_TYPES.REFRACT_COUNT.data_type),

            # post-spike reset membrane voltage [mV]
            # REAL     V_reset;
            NeuronParameter(self._v_reset, _LIF_TYPES.V_RESET.data_type),

            # refractory time of neuron [timesteps]
            # int32_t  T_refract;
            NeuronParameter(self._tau_refrac_timesteps(machine_time_step),
                            _LIF_TYPES.TAU_REFRACT.data_type)
        ])
        return params
Beispiel #18
0
    def get_global_parameters(self, machine_time_step):

        # TODO: update to match the global parameters
        # Note: This must match the order of the parameters in the
        # global_neuron_t data structure in the C code
        return [

            # uint32_t machine_time_step
            NeuronParameter(machine_time_step, DataType.UINT32)
        ]
Beispiel #19
0
    def get_global_parameters(self):
        # Note: This must match the order of the parameters in the
        # global_neuron_t data structure in the C code
        return [

            # uint32_t machine_time_step
            NeuronParameter(self._machine_time_step, DataType.UINT32),
            NeuronParameter(0.0, DataType.S1615),
            NeuronParameter(0.0, DataType.S1615),
            NeuronParameter(0, DataType.INT32),
            NeuronParameter(0.0, DataType.S1615),
            NeuronParameter(0, DataType.INT32),
            NeuronParameter(0.0, DataType.S1615),
            NeuronParameter(0.0, DataType.S1615),
            NeuronParameter(0.0, DataType.S1615)
        ]
    def get_synapse_type_parameters(self, machine_time_step):
        e_decay, e_init = get_exponential_decay_and_init(
            self._tau_syn_E, machine_time_step)
        e_decay2, e_init2 = get_exponential_decay_and_init(
            self._tau_syn_E2, machine_time_step)
        i_decay, i_init = get_exponential_decay_and_init(
            self._tau_syn_I, machine_time_step)

        return [
            NeuronParameter(e_decay, _DUAL_EXP_TYPES.E_DECAY.data_type),
            NeuronParameter(e_init, _DUAL_EXP_TYPES.E_INIT.data_type),
            NeuronParameter(e_decay2, _DUAL_EXP_TYPES.E2_DECAY.data_type),
            NeuronParameter(e_init2, _DUAL_EXP_TYPES.E2_INIT.data_type),
            NeuronParameter(i_decay, _DUAL_EXP_TYPES.I_DECAY.data_type),
            NeuronParameter(i_init, _DUAL_EXP_TYPES.I_INIT.data_type),
            NeuronParameter(self._initial_input_exc,
                            _DUAL_EXP_TYPES.INITIAL_EXC.data_type),
            NeuronParameter(self._initial_input_exc2,
                            _DUAL_EXP_TYPES.INITIAL_EXC2.data_type),
            NeuronParameter(self._initial_input_inh,
                            _DUAL_EXP_TYPES.INITIAL_INH.data_type)
        ]
Beispiel #21
0
    def get_parameters(self):
        """
        Generate Neuron Parameter data (region 2):
        """

        # Get the parameters:
        # typedef struct neuron_t {
        #
        # // nominally 'fixed' parameters
        #     REAL         A;
        #     REAL         B;
        #     REAL         C;
        #     REAL         D;
        #
        # // Variable-state parameters
        #     REAL         V;
        #     REAL         U;
        #
        # // offset current [nA]
        #     REAL         I_offset;
        #
        # // current timestep - simple correction for threshold in beta version
        #     REAL         this_h;
        # } neuron_t;
        return [
            # Currently softfloat not defined on the Python side, so have to use S1615
            NeuronParameter(self._a, DataType.S1615),
            NeuronParameter(self._b, DataType.S1615),
            NeuronParameter(self._c, DataType.S1615),
            NeuronParameter(self._d, DataType.S1615),
            NeuronParameter(self._v_init, DataType.S1615),
            NeuronParameter(self._u_init, DataType.S1615),
            # delete this
            NeuronParameter(self.ioffset(self._machine_time_step),
                            DataType.S1615),
            #NeuronParameter(0, DataType.S1615) # no idea what this, delete it
        ]
 def get_threshold_parameters(self):
     return [NeuronParameter(self._v_thresh, DataType.S1615)]
Beispiel #23
0
 def get_global_parameters(self, machine_time_step):
     return [
         NeuronParameter(machine_time_step / 1000.0,
                         _IZH_GLOBAL_TYPES.TIMESTEP.data_type)
     ]
 def get_threshold_parameters(self):
     return [
         NeuronParameter(self._v_thresh, _STATIC_TYPES.V_THRESH.data_type)
     ]
Beispiel #25
0
 def get_global_parameters(self):
     return [
         NeuronParameter(self._machine_time_step / 1000.0, DataType.S1615)
     ]
 def get_input_type_parameters(self):
     return [
         NeuronParameter(self._e_rev_E, DataType.S1615),
         NeuronParameter(self._e_rev_I, DataType.S1615)
     ]
 def test_create_new_neuron_parameter_none_datatype(self):
     np = NeuronParameter(1, None)
     self.assertEqual(np.get_value(), 1)
     self.assertEqual(np.get_dataspec_datatype(), None)
 def get_parameters(self):
     return [
         NeuronParameter(self._exp_tau_ca2, DataType.S1615),
         NeuronParameter(self._i_ca2, DataType.S1615),
         NeuronParameter(self._i_alpha, DataType.S1615)
     ]