mlpy.optimize.utils.is_converged¶
-
mlpy.optimize.utils.
is_converged
(fval, prev_fval, thresh=0.0001, warn=False)[source]¶ Check if an objective function has converged.
Parameters: fval : float
The current value.
prev_fval : float
The previous value.
thresh : float
The convergence threshold.
warn : bool
Flag indicating whether to warn the user when the fval decreases.
Returns: bool :
Flag indicating whether the objective function has converged or not.
Notes
The test returns true if the slope of the function falls below the threshold; i.e.
where