開源 · GPU 加速
EvoX Runtime
GPU 加速的進化計算框架
EvoX Runtime 是一個分散式、GPU 加速的可擴展進化計算框架——50+ 單目標與多目標最佳化演算法、神經進化與進化強化學習,全面相容 PyTorch。
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()