Benchmarks for model-based optimization.
Evobench is a collection of benchmark problems dedicated for model-based large scale optimization.
This package contains following problems.
- step trap
- step bimodal
- Ising Spin Glass
- step trap
- step multimodal
You can create your own benchmark made of other benchmarks.
pip install evobench
import evobench trap = evobench.discrete.Trap(blocks=[4, 4, 4]) population = trap.initialize_population(population_size=1e3) fitness = trap.evaluate_population(population)
You can also evaluate single solution.
fitness = trap.evaluate_solution(population.solutions)
Every time you're evaluating solutions we increment ffe counter.
Solution is not evaluated again, if it didn't change.
You can access it through
Ising Spin Glass
To instantiate ISG you need to pass specific problem configuration.
from evobench.discrete import IsingSpinGlass isg = IsingSpinGlass('IsingSpinGlass_pm_16_0')
You can find 5,000 instances at
evobench\discrete\isg\data folder. Instances vary in length and complexity.
Creating your own compound benchmarks is really easy.
You just need to define your sub-benchmarks and pass them as a list. All other fuctions work just the same as with the normal
from evobench import CompoundBenchmark from evobench import continuous, discrete benchmark = CompoundBenchmark( benchmarks=[ discrete.Trap(blocks=[5, 2, 4]), continuous.Trap(blocks=[3, 6, 4]) ], use_shuffle=True, multiprocessing=True, verbose=1 ) population = benchmark.initialize_population(population_size=1000) benchmark.evaluate_population(population)
How to implement your own function
You need to inherit
Separable class from
Then just implement
def evaluate_block(self, block: np.ndarray) -> int method. Best follow
Benchmark class from
evobench.benchmark. Then implement
def _evaluate_solution(self, solution: Solution) -> float method.
Linkage quality metrics are located at
- fill quality
We'll be adding more problems in the near future. If you're looking for any particular problem, please mail us or open an issue. We're working on linkage quality metrics. Once they're published, we'll be incorporating them to this package.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size evobench-0.4.2-py3-none-any.whl (12.9 MB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size evobench-0.4.2.tar.gz (17.2 kB)||File type Source||Python version None||Upload date||Hashes View|