gemseo / algos

Show inherited members

stop_criteria module

Various termination criteria for drivers.

exception gemseo.algos.stop_criteria.DesvarIsNan[source]

Bases: TerminationCriterion

Stops driver when the design variables are nan.

exception gemseo.algos.stop_criteria.FtolReached[source]

Bases: TerminationCriterion

Exception raised when the f_tol_rel or f_tol_abs criteria is reached.

exception gemseo.algos.stop_criteria.FunctionIsNan[source]

Bases: TerminationCriterion

Stops driver when a function has NaN value or NaN Jacobian.

exception gemseo.algos.stop_criteria.MaxIterReachedException[source]

Bases: TerminationCriterion

Exception raised when the maximum number of iterations is reached.

exception gemseo.algos.stop_criteria.MaxTimeReached[source]

Bases: TerminationCriterion

Exception raised when the maximum execution time is reached.

exception gemseo.algos.stop_criteria.TerminationCriterion[source]

Bases: Exception

Stop driver for some reason.

exception gemseo.algos.stop_criteria.XtolReached[source]

Bases: TerminationCriterion

Exception raised when the x_tol_rel or x_tol_abs criteria is reached.

gemseo.algos.stop_criteria.is_f_tol_reached(opt_problem, f_tol_rel=1e-06, f_tol_abs=1e-06, n_x=2)[source]

Tests if the tolerance on the objective function are reached.

The average function value of the last n_x points are taken Then it is checked that all points are within the distance of the center with relative and absolute tolerances specified by the user.

Parameters:
  • opt_problem (OptimizationProblem) – the optimization problem containing the iterations

  • f_tol_rel (float) –

    relative tolerance

    By default it is set to 1e-06.

  • f_tol_abs (float) –

    absolute tolerance

    By default it is set to 1e-06.

  • n_x (int) –

    number of design vectors to account for

    By default it is set to 2.

Return type:

bool | bool_

gemseo.algos.stop_criteria.is_x_tol_reached(opt_problem, x_tol_rel=1e-06, x_tol_abs=1e-06, n_x=2)[source]

Tests if the tolerance on the design variables are reached.

The coordinate wise average of the last n_x points are taken Then it is checked that all points are within the distance of the center with relative and absolute tolerances specified by the user.

Parameters:
  • opt_problem (OptimizationProblem) – the optimization problem containing the iterations

  • x_tol_rel (float) –

    relative tolerance

    By default it is set to 1e-06.

  • x_tol_abs (float) –

    absolute tolerance

    By default it is set to 1e-06.

  • n_x (int) –

    number of design vectors to account for

    By default it is set to 2.

Return type:

bool | bool_