fpm_rs/diagnostics/convergence.rs
1//! Iteration-level convergence records assembled by diagnostic recorders.
2
3use serde::{Deserialize, Serialize};
4
5/// Optional convergence scalars recorded for one completed iteration.
6#[derive(Clone, Debug, Serialize, Deserialize)]
7pub struct IterationDiagnostics {
8 /// One-based completed iteration number.
9 pub iteration: usize,
10
11 /// Full reported objective, when available.
12 pub total_objective: Option<f64>,
13 /// Data-fidelity contribution to the objective, when separated by the solver.
14 pub data_objective: Option<f64>,
15 /// Regularization contribution to the objective, when separated by the solver.
16 pub regularization_objective: Option<f64>,
17
18 /// Relative change in the complex object field since the previous snapshot.
19 pub object_relative_change: Option<f64>,
20 /// Relative change in the complex pupil since the previous snapshot.
21 pub pupil_relative_change: Option<f64>,
22
23 /// Median acquisition-frame objective for this iteration.
24 pub median_frame_objective: Option<f64>,
25 /// Maximum acquisition-frame objective for this iteration.
26 pub worst_frame_objective: Option<f64>,
27
28 /// Wall-clock seconds elapsed since reconstruction start.
29 pub elapsed_seconds: Option<f64>,
30}