Skip to content
/ delo Public

Adaptation of population-based optimization algorithms with the usage of Elo rating system

License

Notifications You must be signed in to change notification settings

MrDomani/delo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Differenital Evolution with Elo-based adaptation

Documentation Status
documentation

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

Open terminal and execute command

pip install delo

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:

  1. SHADE
  2. "For a more comprehensive introduction to ES, see Beyer and Schwefel (2002)" ~ preprint from 2021: "Hyperparameter Optimization: Foundations, Algorithms, Best Practices and Open Challenges"
  3. Beyer, H.-G., & Schwefel, H.-P. (2002). Evolution strategies - A comprehensive introduction. Natural Computing, 1, 3–52. springer link

ELO system for chess explained:

  1. https://youtu.be/AsYfbmp0To0
  2. https://en.wikipedia.org/wiki/Elo_rating_system

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.

About

Adaptation of population-based optimization algorithms with the usage of Elo rating system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages