pylops.optimization.callback.CostToDataCallback

class pylops.optimization.callback.CostToDataCallback(rtol)[source]

Cost to data callback

This callback can be used to stop the solver when the cost parameter of the solver is below a certain threshold defined as a percentage of the Euclidean norm of the data.

Note that the meaning of cost can change from solver to solver - e.g., it can represent the misfit of the data term or the total cost function.

Parameters:
rtolfloat

Percentage of the initial cost below which the solver will stop iterating. For example, if rtol is 0.1, the solver will stop when the cost is below 10% of the Euclidean norm of the data.

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