NeighbourhoodManager¶
Full Name
neuroptimiser.core.processes.NeighbourhoodManager
Description
- class NeighbourhoodManager[source]¶
Bases:
AbstractProcess
Neighbourhood Manager Process
This process manages the neighbourhood of units based on a weight matrix. It computes the number of neighbours for each unit and stores the indices of the neighbours.
- Inports¶
- p_inInPort
Input port for the position tensor.
- fp_inInPort
Input port for the fitness tensor.
- Variables¶
- weight_matrixVar
Variable for the weight matrix used to determine neighbourhoods.
- neighbour_indicesVar
Variable for storing the indices of neighbours for each unit.
- Outports¶
- p_outOutPort
Output port for the position tensor of neighbours.
- fp_outOutPort
Output port for the fitness tensor of neighbours.
See also
neuroptimiser.core.models.PyNeighbourhoodManagerModel
Model implementation of the NeighbourhoodManager process.
- __init__(weights, **kwargs)[source]¶
Initialise the NeighbourhoodManager with the given parameters.
- Parameters:
weights (np.ndarray) – Weight matrix for the neighbourhoods. It should be a 2D numpy array where each row represents the weights of a unit to its neighbours.
- Keyword Arguments:
**kwargs (dict, optional) – Additional keyword arguments to be passed to the parent class AbstractProcess.