evomo.algorithms.tensormoead#

Classes#

TensorMOEAD

TensorMOEA/D

Functions#

pbi(f, w, z[, z_max])

tchebycheff(f, w, z[, z_max])

tchebycheff_norm(f, w, z, z_max)

modified_tchebycheff(f, w, z[, z_max])

weighted_sum(f, w[, z, z_max])

shuffle_rows(→ torch.Tensor)

Shuffle each row of the given matrix independently without using a for loop.

Module Contents#

evomo.algorithms.tensormoead.pbi(f, w, z, z_max=None)#
evomo.algorithms.tensormoead.tchebycheff(f, w, z, z_max=None)#
evomo.algorithms.tensormoead.tchebycheff_norm(f, w, z, z_max)#
evomo.algorithms.tensormoead.modified_tchebycheff(f, w, z, z_max=None)#
evomo.algorithms.tensormoead.weighted_sum(f, w, z=None, z_max=None)#
evomo.algorithms.tensormoead.shuffle_rows(matrix: torch.Tensor) → torch.Tensor#

Shuffle each row of the given matrix independently without using a for loop.

Args:

matrix (torch.Tensor): A 2D tensor.

Returns:

torch.Tensor: A new tensor with each row shuffled differently.

class evomo.algorithms.tensormoead.TensorMOEAD(pop_size: int, n_objs: int, lb: torch.Tensor, ub: torch.Tensor, aggregate_op=('pbi', 'pbi'), selection_op: Callable | None = None, mutation_op: Callable | None = None, crossover_op: Callable | None = None, device: torch.device | None = None)#

Bases: evox.core.Algorithm

TensorMOEA/D

This is a tensorized implementation of the original MOEA/D algorithm, which incorporates GPU acceleration for improved computational performance in solving multi-objective optimization problems.

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

[2] Z. Liang, H. Li, N. Yu, K. Sun, and R. Cheng, “Bridging Evolutionary Multiobjective Optimization and

GPU Acceleration via Tensorization,” IEEE Transactions on Evolutionary Computation, 2025. Available: https://ieeexplore.ieee.org/document/10944658

Note:

This implementation differs from the original MOEA/D algorithm by incorporating tensorization for GPU acceleration, significantly improving performance for large-scale optimization tasks.

Initialize tensorized MOEA/D with configurable aggregation for two update stages.

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,), 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.

  • aggregate_op (tuple[str, str]) – Default: ('pbi', 'pbi'). Two aggregation names: the first compares offspring with incumbents, and the second chooses among eligible offspring for a subproblem. Each name must be pbi, tchebycheff, tchebycheff_norm, modified_tchebycheff or weighted_sum. These are names, not callables.

  • selection_op (Callable or None) – Default: None. Accepted and stored, but not called by the current optimization step. Neighborhood parents are shuffled internally, so a custom value has no effect on selection.

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

  • crossover_op (Callable or None) – Default: None. Crossover callable crossover_op(parents) -> offspring. For each pair of parents, return one child. The step passes 2 * N parents and expects N offspring rows. Preserve the decision dimension and device. None selects EvoX’s simulated_binary_half.

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

The sampled population size must be greater than 10, providing at least two neighborhood parents.

get_aggregation_function(name: str) → Callable#
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.