pylops.optimization.callback.MetricsCallback#
- class pylops.optimization.callback.MetricsCallback(xtrue, Op=None, which=('mae', 'mse', 'snr', 'psnr'))[source]#
Metrics callback
This callback can be used to store different metrics from the
pylops.utils.metrics
module during iterations.- Parameters
- xtrue
np.ndarray
True model vector
- Op
pylops.LinearOperator
, optional Operator to apply to the solution prior to comparing it with xtrue
- which
tuple
, optional List of metrics to compute (currently available: “mae”, “mse”, “snr”, and “psnr”)
- xtrue
Methods
__init__
(xtrue[, Op, which])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