Join us in Silicon Valley September 18-19 at the 2024 EvoX Conference. Learn more.

Evolutionary Computation for Everyone

EvoX is All You Need

Get started

EvoX v1.1.1 Release Note

What's ChangedThis minor release primarily includes bug fixes and improveme

Read more

MetaDE: Evolving Differential Evolution by Differential Evolution

Differential Evolution (DE), one of the core algorithms in evolutionary

Read more

EvoX 1.1 Release: Now with torch.compile (TorchDynamo)

We are excited to announce the release of EvoX 1.1, introducing full integration

Read more

<< Key Features >>
🚀 Ultra Performance
● Supports acceleration on heterogeneous hardware, including both CPUs and GPUs, achieving over100x speedups.
●  Integrated distributed workflows that scale seamlessly across multiple nodes or devices.
🌐 All-in-One Solution
●   Includes 50+ algorithms for a wide range of use cases, fully supporting single- and multi-objective optimization.
●  Provides a hierarchical architecture for complex tasks such as meta learning, hyperparameter optimization, and neuroevolution.
🛠️ Easy-to-Use Design
●  Fully compatible with EvoX and its ecosystem, simplifying algorithmic development with a tailored programming model.
●  Ensures effortless setup with one-click installation for Windows users.
📚 Extensive Benchmark Suites
●  Features 100+ benchmark problems spanning single-objective optimization, multi-objective optimization, and real-world engineering challenges.
🎮 Support for Physics Engines
●  Integrates seamlessly with physics engines like Brax and other popular frameworks for reinforcement learning.
⚙️ Customizable Problems
●  Provides an encapsulated module for defining and evaluating custom problems tailored to user needs, with seamless integration into real-world applications and datasets.
🔍 Ready-to-Use Tools
●  Offers a comprehensive set of visualization tools for analyzing evolutionary processes across various tasks.
🛠️ Customizable Modules
●  Enables users to integrate their own visualization code, allowing for tailored and flexible visualizations.
📂 Real-Time Data Streaming
●  Leverages the tailored .exv format to simplify and accelerate real-time data streaming.
Single-objective Optimization
import torch
from evox.algorithms.pso_variants import PSO
from evox.problems.numerical import Ackley
from evox.workflows import StdWorkflow, EvalMonitor

torch.set_default_device("cuda")
# Define the algorithm
algorithm = PSO(pop_size=100, lb=-32 * torch.ones(10), ub=32 * torch.ones(10))
problem = Ackley()
monitor = EvalMonitor()
workflow = StdWorkflow(algorithm, problem, monitor)

workflow.init_step()
for i in range(100):
workflow.step()

monitor.plot()
 
Multi-objective Optimization
import torch
from evox.algorithms import RVEA
from evox.problems.numerical import DTLZ2
from evox.workflows import StdWorkflow, EvalMonitor

torch.set_default_device("cuda")
prob = DTLZ2(m=3)
pf = prob.pf()
algo = RVEA(pop_size=100, n_objs=3, lb=-torch.zeros(12), ub=torch.ones(12))
monitor = EvalMonitor()
workflow = StdWorkflow(algo, prob, monitor)

workflow.init_step()
for i in range(100):
workflow.step()
 
Neuroevolution
import torch
import torch.nn as nn
from evox.algorithms import PSO
from evox.problems.neuroevolution.brax import BraxProblem
from evox.utils import ParamsAndVector
from evox.workflows import EvalMonitor, StdWorkflow


class SimpleMLP(nn.Module):
    def __init__(self):
        super().__init__()
        # observation space is 17-dim, action space is 6-dim.
        self.features = nn.Sequential(nn.Linear(17, 8), nn.Tanh(), nn.Linear(8, 6))

    def forward(self, x):
        x = self.features(x)
        return torch.tanh(x)


# Initialize the MLP model
torch.set_default_device('cuda')
model = SimpleMLP()
adapter = ParamsAndVector(dummy_model=model)

# Set the population size
POP_SIZE = 1024

# Get the bound of the PSO algorithm
model_params = dict(model.named_parameters())
pop_center = adapter.to_vector(model_params)
lb = torch.full_like(pop_center, -5)
ub = torch.full_like(pop_center, 5)

# Initialize the PSO, and you can also use any other algorithms
algorithm = PSO(pop_size=POP_SIZE, lb=lb, ub=ub)

# Initialize the Brax problem
problem = BraxProblem(
    policy=model,
    env_name="halfcheetah",
    max_episode_length=1000,
    num_episodes=3,
    pop_size=POP_SIZE,
)

# set an monitor, and it can record the top 3 best fitnesses
monitor = EvalMonitor(topk=3)

# Initiate an workflow
workflow = StdWorkflow(
    algorithm=algorithm,
    problem=problem,
    monitor=monitor,
    opt_direction="max",
    solution_transform=adapter,
)

workflow.init_step()
for i in range(50):
    workflow.step() 

Docs

Access comprehensive developer documentation for EvoX

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources
仿站工具箱