src.baseline.bbo.shade¶
Module Contents¶
Classes¶
API¶
- class src.baseline.bbo.shade.SHADE(config)[source]¶
Bases:
src.environment.optimizer.basic_optimizer.Basic_OptimizerIntroduction¶
A parameter adaptation technique for DE which uses a historical memory of successful control parameter settings to guide the selection of future control parameter values.
Original paper¶
“Success-history based parameter adaptation for differential evolution.” 2013 IEEE Congress on Evolutionary Computation. IEEE, 2013.
Initialization
Introduction¶
Initializes the class with the provided configuration, sets up population size, logging intervals, and metadata options.
Args:¶
config (object):
The Attributes needed for the SHADE in config are the following:
log_interval (int): Interval at which logs are recorded. Default is maxFEs // n_logpoint.
n_logpoint (int): Number of log points for tracking progress. Default is 50.
full_meta_data (bool): Flag indicating whether to store complete solution history. Default is False.
maxFEs (int): Maximum number of function evaluations allowed. Default directly depends on the type of the problem.
Attributes:¶
NP (int):Set the population size in config object. Default is 50.
__config (object): Stores the configuration object internally.
- __str__()[source]¶
Introduction¶
Returns a string representation of the SHADE algorithm class.
Returns:¶
str: The string “SHADE”.
- run_episode(problem)[source]¶
Introduction¶
Executes a single optimization episode using the SHADE algorithm on the provided problem instance. Tracks the best solution found at specified logging intervals and optionally collects full meta-data for each iteration.
Args:¶
problem: An object representing the optimization problem. Must have the following attributes and methods:
dim(int): Dimensionality of the problem.lb(array-like): Lower boundary of the search space.ub(array-like): Upper boundary of the search space.optimum(float or None): Known optimum value of the problem, or None if unknown.eval(x)(callable): Function to evaluate the fitness of a solutionx.__str__()(callable): Returns a string representation of the problem.
Returns:¶
dict: A dictionary containing:
'cost'(list): Best fitness values found at each logging interval.'fes'(int): Total number of function evaluations performed.'metadata'(dict, optional): Ifself.full_meta_datais True, includes:'X'(list): List of solution populations at each iteration.'Cost'(list): List of fitness values for each population at each iteration.
Raises:¶
None directly, but may propagate exceptions from the problem’s
evalmethod or from the SHADE optimizer.