inversion_ideas.conditions.ObjectiveChanged#
- class inversion_ideas.conditions.ObjectiveChanged(objective_function, rtol=0.001, atol=0.0)#
Stopping criterion for when an objective function didn’t changed above a tolerance.
- Parameters:
- objective_functionObjective
Objective function that will be evaluated.
- rtolfloat, optional
Relative tolerance below which the model will be considered of not changing enough.
- atolfloat, optional
Absolute tolerance below which the model will be considered of not changing enough.
Methods
__call__(model)Call self as a function.
info(model)Display information about the condition for a given model.
Initialize condition and clean
previousattribute.ratio(model)Ratio
|φ(m) - φ(m_prev)|/|φ(m_prev)|.update(model)Cache value of objective function with model as the
previousone.Notes
The stopping criterion evaluates:
\[\frac{ | \phi(\mathbf{m}) - \phi(\mathbf{m}_\text{old}) | }{ | \phi(\mathbf{m}_\text{old}) | } \le \delta_r,\]and
\[| \phi(\mathbf{m}) - \phi(\mathbf{m}_\text{old}) | \le \delta_a,\]where \(\phi\), is the objective function, \(\mathbf{m}\) is the current model, \(\mathbf{m}_\text{old}\) is the previous model in the inversion, and \(\delta_r\) and \(\delta_a\) are the relative and absolute tolerances whose values are given by
rtolandatol, respectively.When called, if any of those inequalities hold, the stopping criterion will return
True, andFalseotherwise.
Methods#
Methods documentation
- ObjectiveChanged.__call__(model)#
Call self as a function.
- ObjectiveChanged.info(model)#
Display information about the condition for a given model.
- ObjectiveChanged.initialize()#
Initialize condition and clean
previousattribute.
- ObjectiveChanged.ratio(model)#
Ratio
|φ(m) - φ(m_prev)|/|φ(m_prev)|.
- ObjectiveChanged.update(model)#
Cache value of objective function with model as the
previousone.