Threshold Check (threshold_check)¶
- class pypint.utilities.threshold_check.ThresholdCheck(min_threshold=1e-07, max_threshold=10, conditions=('solution reduction', 'iterations'))[source]¶
Bases: builtins.object
Threshold Checking Handler
- __init__(min_threshold=1e-07, max_threshold=10, conditions=('solution reduction', 'iterations'))[source]¶
Parameters: - min_threshold (float) – threshold value for minimum criteria
- max_threshold (int) – threshold value for maximum criteria
- conditions (tuple of str) –
Tuple of strings defining the active criteria. Possible values are:
- “error reduction“
- “solution reduction“
- “residual“
- “error“
- “iterations“
(defaults to: ('solution reduction', 'iterations'))
- compute_reduction(state)[source]¶
Computes the reduction of the error and solution
With respect to the supremum nomr of the given state’s current iteration (see ISolverState.current_iteration and IIterationState). In case no previous iteration is available, it immediatly returns.
- has_reached(log=False, human=False)[source]¶
Gives list of thresholds reached
Parameters: human (bool) – if True returns a human readable string listing reached thresholds (default False) Returns: reached_thresholds – list of matched thresholds or None if non reached Return type: list or None
- __weakref__¶
list of weak references to the object (if defined)
- max_iterations[source]¶
Read-only accessor for the maximum iterations threshold
Returns: iterations_threshold – None if iterations is not a criteria Return type: int or None
- min_error[source]¶
Read-only accessor for the minimum error threshold
Returns: error_threshold – None if error is not a criteria Return type: float or None
- min_error_reduction[source]¶
Read-only accessor for the minimum reduction threshold for the error
Returns: reduction_threshold – None if reduction of error is not a criteria Return type: float or None