evox.algorithms.so.de_variants.sade

Module Contents

Classes

SaDE

The implementation of SaDE algorithm.

Data

API

evox.algorithms.so.de_variants.sade.rand_1_bin

[0, 0, 1, 0]

evox.algorithms.so.de_variants.sade.rand_2_bin

[0, 0, 2, 0]

evox.algorithms.so.de_variants.sade.rand2best_2_bin

[0, 1, 2, 0]

evox.algorithms.so.de_variants.sade.current2rand_1

[0, 0, 1, 2]

class evox.algorithms.so.de_variants.sade.SaDE(pop_size: int, lb: torch.Tensor, ub: torch.Tensor, diff_padding_num: int = 9, LP: int = 50, device: torch.device | None = None)[source]

Bases: evox.core.Algorithm

The implementation of SaDE algorithm.

Reference: Qin A K, Huang V L, Suganthan P N. Differential evolution algorithm with strategy adaptation for global numerical optimization[J]. IEEE transactions on Evolutionary Computation, 2008, 13(2): 398-417.

Initialization

Initialize the SaDE algorithm with the given parameters.

Parameters:
  • pop_size – The size of the population.

  • lb – The lower bounds of the search space. Must be a 1D tensor.

  • ub – The upper bounds of the search space. Must be a 1D tensor.

  • diff_padding_num – The number of differential padding vectors to use. Defaults to 9.

  • LP – The size of memory. Defaults to 50.

  • device – The device to use for tensor computations (e.g., “cpu” or “cuda”). Defaults to None.

_get_strategy_ids(strategy_p: torch.Tensor, device: torch.device)[source]
_vmap_get_strategy_ids(strategy_p: torch.Tensor, device: torch.device)[source]
step()[source]

Execute a single optimization step of the SaDE algorithm.

This involves the following sub-steps:

  1. Generate new population using differential evolution.

  2. Evaluate the fitness of the new population.

  3. Update the best individual and best fitness.

  4. Update the success and failure memory.

  5. Update the CR memory.