Welcome to delo’s documentation!¶
delo¶
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 run command:
pip install delo
Example 1¶
1from delo import DElo, DescribedFunction
2import numpy as np
3
4def square(x):
5 return np.sum(x ** 2, axis=1)
6described_function = DescribedFunction(square, dimension=2,
7 domain_lower_limit=-10,
8 domain_upper_limit=10)
9algorithm = DElo(10)
10algorithm.optimize(described_function)
Example 2¶
1from delo import DElo, DescribedFunction
2import numpy as np
3
4def my_single_argument_function(x):
5 return np.sum(x ** 2)
6
7def my_multi_argument_wrapping(x):
8 return np.array([my_single_argument_function(xi) for xi in x])
9
10described_my_function = delo.DescribedFunction(my_multi_argument_wrapping,
11 dimension=5,
12 domain_lower_limit=-5,
13 domain_upper_limit=5)
14algorithm = delo.DElo(100)
15algorithm.optimize(described_my_function, max_f_evals=10000)
Contribute¶
Issue Tracker: github.com/MrDomani/delo/issues
Source Code: github.com/MrDomani/delo
License¶
The project is licensed under the MIT license.