Differential Evolution with Elo-based adaptation
Project description
Differenital Evolution with Elo-based adaptation
Overview
Differential Evolution (DE) optimization algorithms perform satisfactorily even on complex problems in higher dimensionality. However, it is difficult to a priori choose optimal parameters. In this package, we propose DElo (DE with adaptation based on Elo rating system). Elo rating, originally used in chess, is a way to measure dynamic fitness.
Installation
Navigate to repository root folder and execute command
pip install -e .
That installs a developer version - any changes to files in package source will immediately take effect. No reintalls required.
To install a regular version, just execute without -e
option.
Example
import delo
If one have a function that takes a single argument and returns a single value, like this:
def my_single_argument_function(x):
return np.sum(x ** 2)
one have to wrap it like this:
def my_multi_argument_wrapping(x):
return np.array([my_single_argument_function(xi) for xi in x])
described_my_function = delo.DescribedFunction(my_multi_argument_wrapping,
dimension=5,
domain_lower_limit=-5,
domain_upper_limit=5)
Then, one can use DElo to find the optimal value of the function:
algorithm = delo.DElo(100)
solution, best_f_value = algorithm.optimize(described_my_function, max_f_evals=10000)
print(solution, best_f_value)
# [0.0 0.0 -0.0 0.0 0.0], 8.5e-09
Or one can use DEloTQI to find the optimal value of the function:
algorithm = delo.DElo_ties_and_QI(100)
solution, best_f_value = algorithm.optimize(described_my_function, max_f_evals=10000)
print(solution, best_f_value)
# [0.0 -0.0 -0.0 -0.0 0.0], 1.1e-11
References:
- SHADE
- "For a more comprehensive introduction to ES, see Beyer and Schwefel (2002)" ~ preprint from 2021: "Hyperparameter Optimization: Foundations, Algorithms, Best Practices and Open Challenges"
- Beyer, H.-G., & Schwefel, H.-P. (2002). Evolution strategies - A comprehensive introduction. Natural Computing, 1, 3–52. springer link
ELO system for chess explained:
The general idea is when comparing two solutions/genomes/specimens. If one has a better score do not consider it better, but rather it will be the one with a bigger probability of being better.
It is based on where S is sigmoid function
,
is score function,
being i-th specimen.
Acknowledgements
Developped as part of joint Engineer's Thesis of Przemyslaw Adam Chojecki and Pawel Morgen under supervision of Michal Okulewicz, Ph.D. at Warsaw University of Technology.
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 delo-0.9.0.tar.gz
.
File metadata
- Download URL: delo-0.9.0.tar.gz
- Upload date:
- Size: 31.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8952bb8cf973bdfe0aa6690c214c88c8cdebb075aba5dc37c0f46a74d1be9a1 |
|
MD5 | 77d07d3f9a12a8da3326bb26028306e9 |
|
BLAKE2b-256 | 26732dc56415d29b574e1c2247fa0baf62deb7ff53cc3ce1b527feafce0f84ae |
File details
Details for the file delo-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: delo-0.9.0-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e79e2f0549d5986d1ae0db9c4de3aad5d41c988b73b737cd8287f2b03586a9d5 |
|
MD5 | a108ebd46e8212e0c1a83527d19ac892 |
|
BLAKE2b-256 | 9c13261364738c37bf7afe51f47903318edff110e0235e3caad91de549ae3830 |