Neuroevolution Benchmark
Project description
NeuroEvoBench
: Benchmarking Neuroevolution Methods for Machine Learning Applications 🦕 🦖 🐢
This repository contains benchmark results, helper scripts, ES configurations and logs for testing the performance of evolutionary strategies in evosax
and EvoJAX
.
The benchmark is meant to facilitate benchmarking of evolutionary optimization (EO) methods specifically tailored towards neuroevolution methods.
All task evaluations are written in JAX so that population evaluations can be parallelized on accelerators (GPU/TPU). This reduces the evaluation times significantly.
Installation & Setup
# Create a clean conda environment
conda create -n es_bench python=3.9
source activate es_bench
# Install a GPU/TPU compatible jax/jaxlib version
pip install "jax[cuda11_cudnn82]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
# Install the neuroevobench benchmark from PyPi
pip install neuroevobench
Task Availability
Basic NeuroEvoBench
Usage
Individual Benchmark Tasks
- Note that the strategy to be evaluated has to follow the
evosax
ask
-tell
API.
from evosax import Strategies
from neuroevobench.problems.cifar import CifarPolicy
from neuroevobench.problems.cifar import CifarTask
from neuroevobench.problems.cifar import CifarEvaluator
# 1. Create policy for task (CNN classifier)
policy = CifarPolicy()
# 2. Define train/test task based on configs/eval settings
train_task = CifarTask(config.task_config.batch_size, test=False)
test_task = CifarTask(10000, test=True)
# 3. Setup task evaluator with strategy and policy
evaluator = CifarEvaluator(
policy=policy,
train_task=train_task,
test_task=test_task,
popsize=config.popsize,
es_strategy=Strategies[config.strategy_name],
es_config=config.es_config,
es_params=config.es_params,
seed_id=config.seed_id,
log=log,
)
# 4. Run the ES loop with logging
evaluator.run(config.num_generations, config.eval_every_gen)
Running Parameter Search Sweeps
-
Please visit
neuroevobench-analysis
for example configurations used for the 10 EO baselines and 9 neuroevolution tasks. -
You can execute random search sweeps, multi-seed evaluations for the best found settings and individual training runs via the following command line shortcuts:
neb-search --config_fname ${CONFIG_FNAME} --seed_id ${SEED_ID} --experiment_dir ${EXPERIMENT_DIR}
neb-eval --config_fname ${CONFIG_FNAME} --seed_id ${SEED_ID} --experiment_dir ${EXPERIMENT_DIR}
neb-run --config_fname ${CONFIG_FNAME} --seed_id ${SEED_ID} --experiment_dir ${EXPERIMENT_DIR}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file neuroevobench-0.0.1.tar.gz
.
File metadata
- Download URL: neuroevobench-0.0.1.tar.gz
- Upload date:
- Size: 46.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31ee5867f0aa4c6de251a30976f07771079df802c8b1f1047b2cc4c5a6aaed0 |
|
MD5 | 01034fd570bcc33835b43cd535598234 |
|
BLAKE2b-256 | 472ad7cb4974da815b907ebdebda1cbe476e3f1a70bfa2fc95309e7d747951c9 |
File details
Details for the file neuroevobench-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: neuroevobench-0.0.1-py3-none-any.whl
- Upload date:
- Size: 77.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a4e6db518e5b4e91add9d87a5c1ed1fc51aaeb304129d44a00a2e24a11d7250 |
|
MD5 | f3afe4656bc4aa2650cd82ae1a24cd1a |
|
BLAKE2b-256 | e4d9f5247aedc8fd9281e849b8b56d8d59932fc8c82ce87f7eaadf621740e364 |