gemseo.algos.opt.scipy_global.settings.differential_evolution module#

Settings for the SciPy differential evolution algorithm.

Settings DIFFERENTIAL_EVOLUTION_Settings(*, enable_progress_bar=None, eq_tolerance=1e-06, ineq_tolerance=0.0001, log_problem=True, max_time=0.0, normalize_design_space=True, reset_iteration_counters=True, round_ints=True, use_database=True, use_one_line_progress_bar=False, store_jacobian=True, ftol_rel=1e-09, ftol_abs=1e-09, max_iter=9223372036854775807, scaling_threshold=None, stop_crit_n_x=3, xtol_rel=1e-09, xtol_abs=1e-09, strategy='best1bin', popsize=15, tol=0.01, mutation=(0.5, 1.0), recombination=0.7, seed=0, disp=False, polish=True, init='latinhypercube', atol=0.0, updating='immediate', workers=1)[source]#

Bases: BaseSciPyGlobalSettings

The SciPy differential evolution setting.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:
  • enable_progress_bar (bool | None)

  • eq_tolerance (Annotated[float, Ge(ge=0), Ge(ge=0)]) --

    By default it is set to 1e-06.

  • ineq_tolerance (Annotated[float, Ge(ge=0)]) --

    By default it is set to 0.0001.

  • log_problem (bool) --

    By default it is set to True.

  • max_time (Annotated[float, Ge(ge=0)]) --

    By default it is set to 0.0.

  • normalize_design_space (bool) --

    By default it is set to True.

  • reset_iteration_counters (bool) --

    By default it is set to True.

  • round_ints (bool) --

    By default it is set to True.

  • use_database (bool) --

    By default it is set to True.

  • use_one_line_progress_bar (bool) --

    By default it is set to False.

  • store_jacobian (bool) --

    By default it is set to True.

  • ftol_rel (Annotated[float, Ge(ge=0), Ge(ge=0)]) --

    By default it is set to 1e-09.

  • ftol_abs (Annotated[float, Ge(ge=0), Ge(ge=0)]) --

    By default it is set to 1e-09.

  • max_iter (Annotated[int, Gt(gt=0), Gt(gt=0)]) --

    By default it is set to 9223372036854775807.

  • scaling_threshold (Annotated[float, Ge(ge=0)] | None)

  • stop_crit_n_x (Annotated[int, Ge(ge=2)]) --

    By default it is set to 3.

  • xtol_rel (Annotated[float, Ge(ge=0), Ge(ge=0)]) --

    By default it is set to 1e-09.

  • xtol_abs (Annotated[float, Ge(ge=0), Ge(ge=0)]) --

    By default it is set to 1e-09.

  • strategy (str) --

    By default it is set to "best1bin".

  • popsize (Annotated[int, Gt(gt=0)]) --

    By default it is set to 15.

  • tol (Annotated[float, Ge(ge=0)]) --

    By default it is set to 0.01.

  • mutation (float | tuple[float, float]) --

    By default it is set to (0.5, 1.0).

  • recombination (Annotated[float, Le(le=1.0), Ge(ge=0)]) --

    By default it is set to 0.7.

  • seed (int) --

    By default it is set to 0.

  • disp (bool) --

    By default it is set to False.

  • polish (bool) --

    By default it is set to True.

  • init (str | _NDArrayPydantic[Any, dtype[float]]) --

    By default it is set to "latinhypercube".

  • atol (Annotated[float, Ge(ge=0)]) --

    By default it is set to 0.0.

  • updating (str) --

    By default it is set to "immediate".

  • workers (int) --

    By default it is set to 1.

Return type:

None

atol: NonNegativeFloat = 0.0#

The absolute tolerance for convergence.

Constraints:
  • ge = 0

disp: bool = False#

Whether to print convergence messages.

init: str | NDArrayPydantic[float] = 'latinhypercube'#

The method to perform the population initialization as a string or the initial population as an array.

mutation: float | tuple[float, float] = (0.5, 1.0)#

The mutation constant.

If specified as a float it should be in the range [0, 2]. If specified as a tuple(min, max) dithering is employed.

polish: bool = True#

Whether to polish the best population member at the end.

popsize: PositiveInt = 15#

The multiplier for setting the total population size.

Constraints:
  • gt = 0

recombination: NonNegativeFloat = 0.7#

The recombination constant.

Constraints:
  • le = 1.0

  • ge = 0

seed: int = 0#

The random seed.

strategy: str = 'best1bin'#

The differential evolution strategy to use.

tol: NonNegativeFloat = 0.01#

The relative tolerance for convergence.

Constraints:
  • ge = 0

updating: str = 'immediate'#

The best solution vector updating strategy.

workers: int = 1#

The number of parallel workers the population is subdivided in.

model_post_init(context, /)#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that's what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) -- The BaseModel instance.

  • context (Any) -- The context.

Return type:

None