metaheuristic_designer.parameter_schedules.probability_annealing_schedule module#

Annealing schedule for probabilities as seen in simulated annealing.

class ProbabilityAnnealingSchedule(temperature_init=100, iterations=100, alpha=0.99, rng=None)[source]#

Bases: StridedSchedule

Annealing strategies for probabilities.

Holds a temperature parameter that is exponentially decayed and transformed into a probability using an ExponentialDecaySchedule internally.

Parameters:
temperature_initint, optional

Initial temperature, by default 100

iterationsint, optional

iterations to keep the previous parameter without updating, by default 100

alphafloat, optional

multiplier to apply to the temperature each update, by default 0.99

rng

Random state.

Methods

__call__(progress)

Shorthand for evaluate().

evaluate(progress)

Return the parameter value at the given progress.

evaluate(progress)[source]#

Return the parameter value at the given progress.

Return type:

float

Parameters:
progressfloat

Current progress, a number between 0 (start) and 1 (end).

Returns:
Any

The parameter value at this stage of the optimization.

Parameters:

progress (float)

Notes

The return value is not restricted to numbers. You can return: * a float (e.g., a linearly decaying mutation strength), * an int (e.g., a discrete number of mutated components), * a bool (e.g., switching on/off a feature after a threshold), * a string (e.g., switching between strategies), or * any other object that the consuming component expects.

This makes schedules suitable for changing discrete algorithm choices as well as continuous numerical parameters.