Differential evolution with fixed, randomly assigned strategies and control parameters for each individual. Provides JAX and PyTorch implementations for numerical optimization and robotic control.
| Files | Last commit | Last update |
|---|---|---|
🌟 Unleashing the Potential of Differential Evolution through Individual-Level Strategy Diversity 🌟
iStratDE is a minimalist yet powerful Differential Evolution (DE) variant that achieves superior performance through individual-level strategy diversity. Unlike traditional adaptive DEs that adjust strategies at the population level via feedback, iStratDE assigns mutation and crossover strategies along with their respective control parameters randomly and independently to each individual during initialization. These fixed configurations cultivate persistent behavioral heterogeneity, which effectively mitigates premature convergence, particularly in large-population and high-dimensional settings.
Its per-individual strategy assignments support batched execution on GPUs. Mutation still samples vectors from the population, and fitness selection updates the shared population; this is not a claim of communication-free distributed execution. iStratDE is fully integrated into the EvoX framework.
The GitLab main branch contains source version 0.1.0 and separate
JAX and PyTorch implementations. The package pins EvoX 1.1.1; installing the
latest EvoX release is not equivalent to the environment used by this checkout.
Backend speed depends on hardware, population size, problem and compilation;
there is no fixed JAX-to-PyTorch speed ratio.
Features
- Individual-Level Strategy Diversity 🧬: Assigns unique mutation and crossover strategies to each individual at initialization, cultivating persistent behavioral heterogeneity.
- Minimalist & Non-Adaptive 🍃: Achieves robust performance through fixed structural diversity, eliminating the need for complex feedback loops, archives, or dynamic parameter tuning.
- Intrinsic Concurrency ⚡: Batches per-individual mutation, crossover and selection operations on modern GPU architectures.
- Implicit Elitism & Asynchronous Convergence 📈: Leverages elite individuals to steer the search while allowing others to explore along diverse temporal trajectories, effectively mitigating premature convergence.
- Exceptional Scalability 🚀: Explicitly designed to exploit large-scale populations, showing steady performance gains as the population size increases.
- Broad Applicability 🤖: Demonstrates state-of-the-art results across various benchmarks, including CEC2022, and high-dimensional robotic control tasks within the Brax framework.
- Multi-Backend Support 🔥: Native support for both JAX and PyTorch backends, fully integrated with the EvoX framework for seamless hardware acceleration.
RL Tasks Visualization
Using the iStratDE algorithm to solve RL tasks.
The following animations show the behaviors in Brax environments:
|
|
|
| Hopper | Swimmer | Reacher |
- Hopper: Optimizing the environment reward for hopping locomotion.
- Swimmer: Enhancing movement efficiency in fluid environments.
- Reacher: Moving the fingertip to a random target.
Requirements and installation
Use a separate Python 3.10 or 3.11 environment. The package metadata declares
Python >=3.9, but usable versions also depend on the selected dependency wheels.
git clone --branch main https://gitlab.com/emi-lab/istratde.git
cd istratde
Install PyTorch for your CPU or GPU using the official installation guide, then install this checkout with the following compatibility pins:
python -m pip install -e . "evox==1.1.1" "jax==0.4.33" "jaxlib==0.4.33" "numpy==1.26.4" "flax==0.8.5" "optax==0.2.3" "orbax-checkpoint==0.6.1" "brax==0.12.1" "mujoco==3.2.7" "mujoco-mjx==3.2.7" tqdm
This installs the CPU JAX runtime. For NVIDIA GPU execution on a supported Linux host, replace the JAX runtime with the matching CUDA extra, retaining its version:
python -m pip install "jax[cuda12]==0.4.33"
The current import structure loads JAX utilities even through some PyTorch
imports, and importing the local problem modules also imports Brax. Include the
dependencies above for the examples below, including numerical examples that
import those modules. mujoco and mujoco-mjx should use matching versions.
Use editable installation from the checkout so that bundled CEC2022 data remain
available at the paths used by the source.
pyproject.toml pins EvoX 1.1.1, JAX/JAXlib 0.4.33 and NumPy <2.0.
The neuroevolution extra declares Brax 0.12.1 and MuJoCo 3.2.7.
Components
Individual-Level Strategy Pool
iStratDE attains behavioral richness by assigning a unique, immutable strategy profile to each individual at initialization.
- Combinatorial Diversity: A pool of 192 distinct configurations is formed by combining various base vectors, differential vector counts, and crossover schemes.
- Fixed Assignments: Strategies and control parameters (F, CR) are assigned once and remain fixed throughout the evolution, ensuring persistent structural diversity across the population.

GPU Acceleration
iStratDE is fully integrated with the EvoX framework. Both JAX and PyTorch implementations batch population updates; practical population sizes depend on device memory, dimensionality and objective cost.
Examples
Global Optimization Benchmark Functions
import jax.numpy as jnp
import jax
from tqdm import tqdm
from istratde.util import StdSOMonitor, StdWorkflow
from istratde.problems.jax import Sphere
from istratde.algorithms.jax import IStratDE
# Problem settings
D = 10
key_start = 42
# Algorithm settings
POP_SIZE = 256 # Small introductory run; increase for experiments
STEPS = 20
# Define search space
lb = jnp.full((D,), -100.0)
ub = jnp.full((D,), 100.0)
# Initialize iStratDE
algorithm = IStratDE(
lb=lb,
ub=ub,
pop_size=POP_SIZE,
)
# Problem to solve
problem = Sphere()
# Monitor for tracking best fitness
monitor = StdSOMonitor(record_fit_history=False)
# Initialize standard workflow
workflow = StdWorkflow(
algorithm=algorithm,
problem=problem,
monitor=monitor,
)
# Initialize state
key = jax.random.PRNGKey(key_start)
state = workflow.init(key)
# Main optimization loop
for step in tqdm(range(STEPS), desc="Running iStratDE"):
state = workflow.step(state)
# Print result
print(f"Best fitness: {monitor.get_best_fitness()}")
If you want to use the PyTorch backend, run
python -m examples.pytorch.examplefrom the repository root. Reduce the population and iteration settings in that example for a smoke test.
CEC Benchmark Problems
iStratDE includes CEC2022 problems. The following JAX configuration uses a large population and evaluation budget; reduce POP_SIZE and STEPS when checking a new environment:
import jax.numpy as jnp
import jax
from tqdm import tqdm
from istratde.util import StdSOMonitor, StdWorkflow
from istratde.problems.jax import CEC2022TestSuit
from istratde.algorithms.jax import IStratDE
# Problem setting
D = 10 # Dimension (CEC2022 supports 10D, 20D)
FUNC_LIST = jnp.arange(12) + 1 # Functions 1 to 12
key_start = 42
# IStratDE algorithm settings
POP_SIZE = 100000 # Large population size to leverage JAX parallelism
STEPS = 5000 # Total generations
# Define search space for CEC2022
lb = jnp.full((D,), -100.0)
ub = jnp.full((D,), 100.0)
for func_num in FUNC_LIST:
# 1. Create specific CEC2022 problem instance
base_problem = CEC2022TestSuit.create(int(func_num))
print(f"Testing Problem: CEC2022 F{int(func_num)}")
# 2. Initialize IStratDE
algorithm = IStratDE(
lb=lb,
ub=ub,
pop_size=POP_SIZE,
)
# 3. Initialize Monitor
monitor = StdSOMonitor(record_fit_history=False)
# 4. Initialize Workflow directly with the problem
workflow = StdWorkflow(
algorithm=algorithm,
problem=base_problem,
monitor=monitor,
)
# 5. Initialize State
key = jax.random.PRNGKey(key_start)
state = workflow.init(key)
# 6. Main Optimization Loop
for i in tqdm(range(STEPS), desc=f"F{int(func_num)} Progress"):
state = workflow.step(state)
# 7. Final Results
print(f"F{int(func_num)} Best_fitness: {monitor.get_best_fitness()}")
print("-" * 30)
If you want to use the PyTorch backend, please refer to the PyTorch examples under
examples/pytorch/example_cec2022.pyin this repository.
Robotics Control (Evolutionary Reinforcement Learning)
iStratDE is highly effective for real-world applications such as robotic control through evolutionary reinforcement learning (EvoRL). To run these robotic policy optimization examples, ensure you have installed a CUDA-enabled JAX environment along with brax==0.12.1.
from tqdm import tqdm
from jax import random
from flax import linen as nn
import jax.numpy as jnp
import jax
import istratde.problems
from istratde.algorithms.jax import IStratDE
from istratde.util import StdSOMonitor, StdWorkflow, TreeAndVector
# 1. Define Policy Network (Swimmer: 8 obs -> 2 actions)
class SwimmerPolicy(nn.Module):
@nn.compact
def __call__(self, x):
x = x.astype(jnp.float32)
x = x.reshape(-1)
x = nn.Dense(32)(x)
x = nn.tanh(x)
x = nn.Dense(32)(x)
x = nn.tanh(x)
x = nn.Dense(2)(x)
x = nn.tanh(x)
return x
# 2. Setup Parameter Adapter (Flat Vector <-> PyTree)
key = jax.random.PRNGKey(42)
model = SwimmerPolicy()
weights = model.init(random.PRNGKey(42), jnp.zeros((8,))) # Initialize weights
adapter = TreeAndVector(weights)
vector_form_weights = adapter.to_vector(weights)
D = vector_form_weights.shape[0] # Total weight dimension
# 3. Initialize IStratDE Algorithm
steps = 100
pop_size = 10000
lb = jnp.full((D,), -10.0)
ub = jnp.full((D,), 10.0)
algorithm = IStratDE(
lb=lb,
ub=ub,
pop_size=pop_size,
)
# 4. Setup Problem (Brax Swimmer)
problem = istratde.problems.jax.Brax(
env_name="swimmer",
policy=jax.jit(model.apply),
cap_episode=500,
)
# 5. Initialize Workflow
monitor = StdSOMonitor(record_fit_history=False)
workflow = StdWorkflow(
algorithm=algorithm,
problem=problem,
monitor=monitor,
pop_transform=adapter.batched_to_tree, # Convert population back to tree structure
opt_direction='max', # Maximize reward
)
# 6. Run Loop
key, _ = jax.random.split(key)
state = workflow.init(key)
for i in tqdm(range(steps), desc="Swimmer Evolution"):
state = workflow.step(state)
print(f"fitness: {monitor.get_best_fitness()}")
print(f"Best fitness: {monitor.get_best_fitness()}")
If you want to use the PyTorch backend, please refer to the PyTorch examples under
examples/pytorch/example_brax.pyin this repository.
Community & Support
- Engage in discussions and share your experiences on GitLab issues.
- Join our QQ group (ID: 297969717).
Citing iStratDE
@ARTICLE{istratde2026,
author={Feng, Chenchen and Chen, Minyang and Li, Zhuozhao and Cheng, Ran},
journal={IEEE Transactions on Evolutionary Computation},
title={Unleashing the Potential of Differential Evolution through Individual-Level Strategy Diversity},
year={2026},
pages={1-1},
keywords={Vectors;Convergence;Optimization;Arithmetic;Tuning;Synchronization;Evolutionary computation;Concurrent computing;Computer science;Benchmark testing;Differential Evolution;Population Diversity;GPU Computing},
doi={10.1109/TEVC.2026.3659799}
}