pylops.optimization.callback.CostToInitialCallback¶
- class pylops.optimization.callback.CostToInitialCallback(rtol)[source]¶
Cost to initial callback
This callback can be used to stop the solver when the
costparameter of the solver is below a certain threshold defined as a percentage of the initial residual norm.Note that the meaning of
costcan change from solver to solver - e.g., it can represent the misfit of the data term or the total cost function.- Parameters:
- rtol
float Percentage of the initial cost below which the solver will stop iterating. For example, if
rtolis 0.1, the solver will stop when the cost is below 10% of the initial cost.
- rtol
Methods
__init__(rtol)on_run_begin(solver, x)Callback before entire solver run
on_run_end(solver, x)Callback after entire solver run
on_setup_begin(solver, x0)Callback before setup
on_setup_end(solver, x)Callback after setup
on_step_begin(solver, x)Callback before step of solver
on_step_end(solver, x)Callback after step of solver