PyPositionReceiverModel

Full Name

neuroptimiser.core.models.PyPositionReceiverModel

Description

class PyPositionReceiverModel[source]

Bases: PyLoihiProcessModel

Position receiver model for Loihi-based perturbation-based nheuristics

This model receives the positions and fitness values of neighbouring agents/units in a neuroptimiser architecture, allowing the spiking core to access this information.

See also

neuroptimiser.core.processes.PositionReceiver

Process that receives the positions and fitness values of neighbouring agents/units in a NeuroHeuristicUnit.

__init__(proc_params)[source]

Initialises the position receiver model with the given parameters.

Arguments
proc_paramsdict
A dictionary containing the parameters for the process model. It must include:
  • agent_id: int, identifier of the agent

  • external_shape: tuple, shape of the external state (e.g., number of neighbours, dimensions, and agents)

fp_in: PyInPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
fp_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
implements_process

alias of PositionReceiver

implements_protocol

alias of LoihiProtocol

p_in: PyInPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyInPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
p_out: PyOutPort = LavaPyType(cls=<class 'lava.magma.core.model.py.ports.PyOutPortVectorDense'>, d_type=<class 'numpy.float32'>, precision=None)
required_resources: ty.List[ty.Type[AbstractResource]] = [<class 'lava.magma.core.resources.CPU'>]
run_spk()[source]

Runs the position receiver process model.

The process is summarised as follows:
  1. Receives the input position tensor and fitness vector from the inports.

  2. Prepares the output position matrix and fitness vector using the input spikes.

  3. Sends the output position matrix and fitness vector to the outports.