TwoDimSpikingCore

Full Name

neuroptimiser.core.processes.TwoDimSpikingCore

Description

class TwoDimSpikingCore[source]

Bases: AbstractSpikingCore

Two-Dimensional Spiking Core Process

This process implements a two-dimensional spiking core with specific neuron models such as linear and Izhikevich. It allows for the definition of coefficients for the models and provides random initial values for the variables v1 and v2.

Inports
s_inInPort

Input port for the spiking activity.

p_inInPort

Input port for the position variable.

fp_inInPort

Input port for the fitness variable.

g_inInPort

Input port for the global best position.

fg_inInPort

Input port for the global best fitness.

xn_inInPort

Input port for the neighbours’ positions.

fxn_inInPort

Input port for the neighbours’ fitness.

Variables
xVar

Variable for the current position of the spiking core.

v1Var

Variable for the first neuromorphic state (e.g., membrane potential).

v2Var

Variable for the second neuromorphic state (e.g., adaptation/auxiliary variable).

Outports
s_outOutPort

Output port for the spiking activity.

x_outOutPort

Output port for the new current position of the spiking core.

See also

AbstractSpikingCore

Base class for spiking cores.

neuroptimiser.core.models.PyTwoDimSpikingCoreModel

Model implementation of the TwoDimSpikingCore process.

__init__(**core_params)[source]

Initialise the TwoDimSpikingCore with the given parameters.

Keyword Arguments:
  • name (str, optional) – Name of the neuron model to be used. Options are linear or izhikevich. Default is linear.

  • coeffs (str | list | np.ndarray, optional) – Coefficients for the neuron model. If a string is provided, it should be in the format model_kind or model_kind_all. If a list or numpy array is provided, it should contain the coefficients for each dimension. Default is None, which uses default coefficients.

  • seed (int, optional) – Seed for the random number generator. Default is a random value based on the current time.

Notes

  • The linear model uses a default coefficient matrix of [[-0.5, -0.5], [0.5, -0.5]].

  • The izhikevich model uses default coefficients for the regular spiking (RS) neuron type: a=0.02, b=0.2, c=-65, d=8, I=0.1.

process_izh_coeffs(coeffs=None) list[source]

Process the coefficients for Izhikevich model.

Parameters:

coeffs (str | list | np.ndarray, optional) – Coefficients for the Izhikevich model. If a string is provided, it should be in the format model_kind or model_kind_all. If a list or numpy array is provided, it should contain the coefficients for each dimension. Default is None, which uses default coefficients.

Returns:

coeffs_ – Processed coefficients for the Izhikevich model.

Return type:

list

process_lin_coeffs(models_coeffs=None) list[source]

Process the coefficients for linear model.

Parameters:

models_coeffs (str | list | np.ndarray, optional) – Coefficients for the linear model. If a string is provided, it should be in the format model_kind or model_kind_all. If a list or numpy array is provided, it should contain the coefficients for each dimension. Default is None, which uses default coefficients.

Returns:

models_coeffs_ – Processed coefficients for the linear model.

Return type:

list

reset() None[source]

Reset the TwoDimSpikingCore to its initial state.