AbstractSpikingCore

Full Name

neuroptimiser.core.processes.AbstractSpikingCore

Description

class AbstractSpikingCore[source]

Bases: AbstractProcess

Abstract process class for a spiking core

This class is designed to be used as a base class for spiking neuron models. It initialises the core parameters and sets up the necessary ports and variables for the spiking core.

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.

Outports
s_outOutPort

Output port for the spiking activity.

x_outOutPort

Output port for the current position of the spiking core.

__init__(noise_std: float | tuple | list = 0.1, alpha: float = 1.0, max_steps: int = 100, **kwargs)[source]

Initialise the spiking core with the given parameters.

Keyword Arguments:
  • noise_std (float | tuple | list, optional) – Standard deviation of the noise added to the spiking core. If a tuple or list is provided, a random value will be sampled from the range defined by the tuple/list. Default is 0.1.

  • alpha (float, optional) – Scaling factor for the spiking core. Default is 1.0.

  • max_steps (int, optional:) – Maximum number of steps for the spiking core to run. Default is 100.

  • num_dimensions (int, optional) – Number of dimensions for the spiking core. Default is 2.

  • init_position (np.ndarray, optional) – Initial position of the spiking core in the defined dimensions. If not provided, a random position will be generated within the range [-1, 1].

  • num_neighbours (int, optional) – Number of neighbours for the spiking core. Default is 0, meaning no neighbours are considered.

reset()[source]

Reset the spiking core to its initial state.