PyNeighbourhoodManagerModel¶
Full Name
neuroptimiser.core.models.PyNeighbourhoodManagerModel
Description
- class PyNeighbourhoodManagerModel[source]¶
Bases:
PyLoihiProcessModel
Neighbourhood manager model for Loihi-based perturbation-based nheuristics
This model manages the neighbourhood of agents/units in a neuroptimiser architecture, allowing them to access the positions and fitness values of their neighbours.
See also
neuroptimiser.core.processes.NeighbourhoodManager
Process that manages the neighbourhood of agents/units in a neuroptimiser architecture.
- __init__(proc_params)[source]¶
Initialises the neighbourhood manager model with the given parameters.
- Arguments
- proc_paramsdict
- A dictionary containing the parameters for the process model. It must include:
num_agents
: int, number of agents in the systemnum_dimensions
: int, number of dimensions in the problem spacenum_neighbours
: int, number of neighbouring 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
NeighbourhoodManager
- implements_protocol¶
alias of
LoihiProtocol
- neighbour_indices: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'int'>, precision=None)¶
- 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 neighbourhood manager process model.
- The process is summarised as follows:
If the process is not initialised, it creates tensors to store the neighbourhood positions and fitness values.
Receives the input position and fitness matrices from the inports.
For each agent/unit, retrieves the positions and fitness values of its neighbours based on the pre-defined indices.
Sends the neighbourhood position and fitness tensors to the outports.
- weight_matrix: ndarray = LavaPyType(cls=<class 'numpy.ndarray'>, d_type=<class 'float'>, precision=None)¶