evomo.algorithms.lmocso#

Classes#

LMOCSO

The tensorized version of LMOCSO algorithm.

Module Contents#

class evomo.algorithms.lmocso.LMOCSO(n_objs: int, pop_size: int, lb: torch.Tensor, ub: torch.Tensor, alpha: float = 2.0, max_gen: int = 100, mutation_op: Callable | None = None, selection_op: Callable | None = None, device: torch.device | None = None)#

Bases: evox.core.Algorithm

The tensorized version of LMOCSO algorithm.

Reference:
[1] Ye Tian, Xiutao Zheng, Xingyi Zhang and Yaochu Jin, “Efficient Large-Scale Multiobjective Optimization Based

on a Competitive Swarm,” in IEEE Transactions on Cybernetics , 2020, pp. 3696 - 3708. Available: https://ieeexplore.ieee.org/document/8681243

Initialize the LMOCSO population and optimization state.

Parameters:
  • 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.

  • pop_size (int) – Required. Requested number of candidate solutions. Use a positive integer; algorithm-specific minimums and reference-vector sampling are described below.

  • lb (torch.Tensor) – Required. Lower decision bounds of shape (D,), where D is the number of decision variables. Use floating-point bounds with the same shape, dtype and device as ub, and lb <= ub elementwise.

  • ub (torch.Tensor) – Required. Upper decision bounds of shape (D,). The decision dimension is inferred from the bounds, rather than passed separately. Match lb in shape, dtype and device.

  • alpha (float) – Default: 2.0. Exponent in the angle-penalty schedule (gen / max_gen) ** alpha used by reference-vector guided selection. A larger positive exponent delays the growth of angular selection pressure.

  • max_gen (int) – Default: 100. Positive generation horizon used to normalize the algorithm’s adaptation schedule. Set it consistently with your run length. It does not stop the workflow; the caller controls the loop.

  • mutation_op (Callable or None) – Default: None. Mutation callable mutation_op(offspring, lb, ub) -> mutated_offspring. Input and output are decision tensors of shape (B, D); preserve device and return an appropriate decision dtype. None selects EvoX’s polynomial_mutation.

  • selection_op (Callable or None) – Default: None. Environmental selection callable selection_op(pop, fit, vectors, theta) -> (pop, fit) for the merged population. Return matching decision and fitness tensors on the input device with the reference-vector output shape. None selects EvoX’s ref_vec_guided.

  • device (torch.device or None) – Default: None. Execution device. None uses torch.get_default_device(); it does not infer the device from the bounds. Bounds are copied to this device. Pass torch.device('cuda') explicitly for GPU execution.

Note

Use this algorithm through a workflow that connects the problem’s evaluation method. Call workflow.init_step() before workflow.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.

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.

cal_fitness(obj)#

Calculate the fitness by shift-based density