inversion_ideas.conditions.ModelChanged#

class inversion_ideas.conditions.ModelChanged(rtol=0.001, atol=0.0)#

Stopping criterion for when model didn’t changed above tolerance.

Parameters:
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()

Initialize condition and clean previous attribute.

update(model)

Cache model as the previous one.

Notes

The stopping criterion evaluates:

\[\frac{ \lVert \mathbf{m} - \mathbf{m}_\text{prev} \rVert_2 }{ \lVert \mathbf{m}_\text{old} \rVert_2 } \le \delta_r,\]

and

\[\lVert \mathbf{m} - \mathbf{m}_\text{prev} \rVert_2 \le \delta_a,\]

where \(\mathbf{m}\) is the current model, \(\mathbf{m}_\text{prev}\) is the previous model in the inversion, \(\lVert \cdot \rVert_2\) represents an \(l_2\) norm, and \(\delta_r\) and \(\delta_a\) are the relative and absolute tolerances whose values are given by rtol and atol, respectively.

When called, if any of those inequalities hold, the stopping criterion will return True, and False otherwise.

Methods#

Methods documentation

ModelChanged.__call__(model)#

Call self as a function.


ModelChanged.info(model)#

Display information about the condition for a given model.


ModelChanged.initialize()#

Initialize condition and clean previous attribute.


ModelChanged.update(model)#

Cache model as the previous one.