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.


True model vector

Oppylops.LinearOperator, optional

Operator to apply to the solution prior to comparing it with xtrue

whichtuple, optional

List of metrics to compute (currently available: “mae”, “mse”, “snr”, and “psnr”)


__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

Examples using pylops.optimization.callback.MetricsCallback

03. Solvers (Advanced)

03. Solvers (Advanced)

03. Solvers (Advanced)