metaheuristic_designer.parameter_schedules.logistic_schedule module#

Schedule that follows a sigmoidal (logistic) transition between two values.

class LogisticSchedule(init_value, final_value, k=10, exact_bounds=False)[source]#

Bases: SchedulableParameter

Schedule that transitions between two values following a sigmoid curve.

The steepness is controlled by k. When exact_bounds is True, the output is rescaled to exactly start at init_value and end at final_value.

Parameters:
init_valuefloat

Starting value.

final_valuefloat

Target value.

kfloat, optional

Steepness of the logistic curve (default 10).

exact_boundsbool, optional

If True, the output is rescaled to hit the exact bounds at progress 0 and 1.

Parameters:
  • init_value (float)

  • final_value (float)

  • k (float)

  • exact_bounds (bool)

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.