evomo.algorithms.moead#
Classes#
Implementation of the Original MOEA/D algorithm. |
Functions#
|
Module Contents#
- evomo.algorithms.moead.pbi(f: torch.Tensor, w: torch.Tensor, z: torch.Tensor)#
- class evomo.algorithms.moead.MOEAD(pop_size: int, n_objs: int, lb: torch.Tensor, ub: torch.Tensor, selection_op: Callable | None = None, mutation_op: Callable | None = None, crossover_op: Callable | None = None, device: torch.device | None = None)#
Bases:
evox.core.AlgorithmImplementation of the Original MOEA/D algorithm.
- References:
- [1] Q. Zhang and H. Li, “MOEA/D: A Multiobjective Evolutionary Algorithm Based on Decomposition,”
IEEE Transactions on Evolutionary Computation, vol. 11, no. 6, pp. 712-731, 2007. Available: https://ieeexplore.ieee.org/document/4358754
- Note:
This implementation is based on the original paper and may not be the most efficient implementation.
Initialize the MOEAD population and optimization state.
- Parameters:
pop_size (int) – Required. Requested number of candidate solutions. Use a positive integer; algorithm-specific minimums and reference-vector sampling are described below.
n_objs (int) – Required. Number of objectives, matching the second dimension of the problem’s objective tensor. Objectives are minimized; this library targets two or more objectives.
lb (torch.Tensor) – Required. Lower decision bounds of shape
(D,), whereDis the number of decision variables. Use floating-point bounds with the same shape, dtype and device asub, andlb <= ubelementwise.ub (torch.Tensor) – Required. Upper decision bounds of shape
(D,). The decision dimension is inferred from the bounds, rather than passed separately. Matchlbin shape, dtype and device.selection_op (Callable or None) – Default:
None. Accepted and stored, but not called by the current optimization step. Mating uses random neighborhood parents internally, so a custom value does not change mating selection.mutation_op (Callable or None) – Default:
None. Mutation callablemutation_op(offspring, lb, ub) -> mutated_offspring. Input and output are decision tensors of shape(B, D); preserve device and return an appropriate decision dtype.Noneselects EvoX’spolynomial_mutation.crossover_op (Callable or None) – Default:
None. Crossover callablecrossover_op(parents) -> offspring. For each pair of parents, return one child. The step passes two parents and expects an offspring batch with one row. Preserve the decision dimension and device.Noneselects EvoX’ssimulated_binary_half.device (torch.device or None) – Default:
None. Execution device.Noneusestorch.get_default_device(); it does not infer the device from the bounds. Bounds are copied to this device. Passtorch.device('cuda')explicitly for GPU execution.
Note
Use this algorithm through a workflow that connects the problem’s evaluation method. Call
workflow.init_step()beforeworkflow.step()or compiling the step. The current evaluation path expects an objective tensor of shape(B, n_objs). It does not consume a(fitness, constraint_violation)tuple.Reference-vector sampling can change the requested population size. Read
self.pop.shape[0]for the actual size.The sampled population size must be greater than 10, providing at least two neighborhood parents.
- init_step()#
Evaluate the initial population and initialize algorithm state.
Invoke through
workflow.init_step()before the first optimization step.- Returns:
None; results are stored in algorithm state.
- step()#
Advance optimization and update population and fitness state in place.
Invoke through
workflow.step()after initialization. The caller controls termination.- Returns:
None; results are stored in algorithm state.