mealpy.sota_based package
mealpy.sota_based.IMODE module
- class mealpy.sota_based.IMODE.OriginalIMODE(epoch: int = 10000, pop_size: int = 100, memory_size: int = 5, archive_size: int = 20, **kwargs: object)[source]
Bases:
OptimizerThe original version of: Improved Multi-operator Differential Evolution Algorithm (IMODE)
Links
This version is conversion from the original MATLAB code available at CEC competition github.
Examples
>>> import numpy as np >>> from mealpy import FloatVar, IMODE >>> >>> def objective_function(solution): >>> return np.sum(solution**2) >>> >>> problem_dict = { >>> "bounds": FloatVar(lb=(-10.,) * 30, ub=(10.,) * 30, name="delta"), >>> "minmax": "min", >>> "obj_func": objective_function >>> } >>> >>> model = IMODE.OriginalIMODE(epoch=1000, pop_size=50, memory_size=5, archive_size=20) >>> g_best = model.solve(problem_dict) >>> print(f"Solution: {g_best.solution}, Fitness: {g_best.target.fitness}") >>> print(f"Solution: {model.g_best.solution}, Fitness: {model.g_best.target.fitness}")
References
[1] Sallam, K. M., Elsayed, S. M., Chakrabortty, R. K., & Ryan, M. J. (2020, July). Improved multi-operator differential evolution algorithm for solving unconstrained problems. In 2020 IEEE congress on evolutionary computation (CEC) (pp. 1-8). IEEE.
mealpy.sota_based.LSHADEcnEpSin module
- class mealpy.sota_based.LSHADEcnEpSin.OriginalLSHADEcnEpSin(epoch: int = 10000, pop_size: int = 100, miu_f: float = 0.5, miu_cr: float = 0.5, freq: float = 0.5, memory_size: int = 5, ps: float = 0.5, pc: float = 0.4, pop_size_min: int = 10, **kwargs: object)[source]
Bases:
OptimizerThe original version of: Ensemble sinusoidal differential covariance matrix adaptation with Euclidean neighborhood (LSHADEcnEpSin)
Links
Examples
>>> import numpy as np >>> from mealpy import FloatVar, LSHADEcnEpSin >>> >>> def objective_function(solution): >>> return np.sum(solution**2) >>> >>> problem_dict = { >>> "bounds": FloatVar(lb=(-10.,) * 30, ub=(10.,) * 30, name="delta"), >>> "minmax": "min", >>> "obj_func": objective_function >>> } >>> >>> model = LSHADEcnEpSin.OriginalLSHADEcnEpSin(epoch=1000, pop_size=50, miu_f = 0.5, miu_cr = 0.5, >>> freq = 0.5, memory_size = 5, ps = 0.5, pc = 0.4, pop_size_min = 10) >>> g_best = model.solve(problem_dict) >>> print(f"Solution: {g_best.solution}, Fitness: {g_best.target.fitness}") >>> print(f"Solution: {model.g_best.solution}, Fitness: {model.g_best.target.fitness}")
References
[1] Awad, N. H., Ali, M. Z., & Suganthan, P. N. (2017, June). Ensemble sinusoidal differential covariance matrix adaptation with Euclidean neighborhood for solving CEC2017 benchmark problems. In 2017 IEEE congress on evolutionary computation (CEC) (pp. 372-379). IEEE.
- covariance_matrix_crossover(target, mutant)[source]
Covariance matrix learning with Euclidean neighborhood
- evolve(epoch)[source]
The main operations (equations) of algorithm. Inherit from Optimizer class
- Parameters
epoch (int) – The current iteration