Skip to content

Adaptive Differential Evolution with Optional External Archive (JADE)

Differential evolution that adapts its scale factor F and crossover rate CR during the run, so it needs little tuning. A strong choice for continuous problems.

JADE

JADE(*, p_best_rate=0.05, c=0.1, archive=True, **kwargs)

JADE: adaptive DE with an optional external archive (Zhang and Sanderson, 2009).

Strategy DE/current-to-pbest/1/bin. Each trial vector i gets CR_i ~ N(mu_CR, 0.1) clipped to [0, 1] and F_i ~ Cauchy(mu_F, 0.1), drawn again while F_i <= 0 and truncated to 1. After each iteration, with S_CR and S_F the values of the successful trial vectors, mu_CR = (1 - c) mu_CR + c mean(S_CR) and mu_F = (1 - c) mu_F + c lehmer_mean(S_F). Both start at 0.5.

Parameters

  • pop_size: population size N (default 100).
  • p_best_rate: p, the fraction of the best members that pbest is drawn from (default 0.05).
  • c: learning rate of mu_CR and mu_F (default 0.1).
  • archive: keep the external archive of replaced parents, at most N members (default True).

Reference: J. Zhang and A. C. Sanderson, "JADE: Adaptive differential evolution with optional external archive", IEEE Transactions on Evolutionary Computation 13(5), 945 to 958 (2009).

Rules shared with SHADE and L-SHADE

JADE, SHADE and L-SHADE use DE/current-to-pbest/1/bin with an external archive of replaced parents, and adapt F and CR from the trial vectors that succeed.

  • F is drawn from Cauchy(m_F, 0.1), again while F <= 0, and truncated to 1. CR is drawn from N(m_CR, 0.1) and clipped to [0, 1]. The means m_F and m_CR are what each algorithm adapts, and an L-SHADE slot with the terminal value gives CR = 0.
  • SHADE and L-SHADE replace the parent when the trial vector is at least as good, JADE only when it is strictly better. A trial counts as a success only when it is strictly better.
  • A trial component outside the bounds is set to the midpoint between the parent's value and the violated bound.

Example

import ypea

problem = ypea.Problem(
    ypea.Real("x", shape=20, lb=-10, ub=10),
    lambda sol: ypea.benchmarks.sphere(sol.x),
    vectorized=True,
    name="sphere",
)

alg = ypea.JADE(max_nfe=20_000)
result = alg.solve(problem, seed=1)
print(result.summary())
JADE on sphere
  best objective value: 1.15542e-07
  feasible: True (violation 0)
  evaluations: 20000, iterations: 199, time: 0.0549 s, stopped by: max_nfe

Differs from Python: MATLAB draws its own random numbers, so the best value differs from Python's.

problem = ypea.Problem( ...
    vars=ypea.Real("x", shape=20, lb=-10, ub=10), ...
    objective=@(sol) ypea.benchmarks.sphere(sol.x), ...
    vectorized=true, ...
    name="sphere");

alg = ypea.JADE(max_nfe=20000);
result = alg.solve(problem, seed=1);
disp(result.summary())
JADE on sphere
  best objective value: 4.4962e-07
  feasible: true (violation 0)
  evaluations: 20000, iterations: 199, time: 0.18 s, stopped by: max_nfe

Search on Rastrigin

JADE solutions on Rastrigin at four iterations, and its convergence
JADE with default settings, 50 iterations on Rastrigin in two dimensions (seed 1). The red points are the current population (its archive of replaced parents is not drawn). The open diamond is the best solution so far, and the plus sign the global minimum.