pub struct Admm {
pub iterations: usize,
pub object_step: f64,
pub penalty: f64,
pub dual_relaxation: f64,
pub batch_size: usize,
pub epsilon: f64,
}Expand description
Linearized ADMM reconstruction for Fourier ptychographic microscopy.
§Method
The algorithm splits each predicted detector field from the shared object by introducing an auxiliary field and a scaled dual variable. Each step alternates among a measurement-amplitude proximal update of the auxiliary fields, a pupil-preconditioned linearized update of the common object spectrum, and a scaled-dual update that drives the auxiliary and predicted fields toward consensus. This separates the nonlinear measurement constraint from the overlapping Fourier-patch consistency constraint.
For incoherently multiplexed data, the amplitude proximal is joint across
all source modes in a frame. Auxiliary and scaled-dual fields are stored per
frame-source mode in ReconstructionState for exact checkpoint resumption.
The fixed-pupil linearization and multiplexed proximal used here are crate
adaptations of the reference ADMM-FPM formulation.
Each iteration reports detector-field RMS residuals. The primal residual is
r_k = A x_k - z_k, evaluated after the linearized object update, and the
dual residual is s_k = rho (z_k - z_{k-1}). Here A x denotes the
concatenated per-mode detector fields, including each mode of a multiplexed
frame. Masked pixels and zero-weight frames are excluded. These residuals
diagnose consensus and auxiliary-field motion; the solver does not use them
as stopping criteria.
§Reference
A. Wang, Z. Zhang, S. Wang, A. Pan, C. Ma, and B. Yao, “Fourier Ptychographic Microscopy via Alternating Direction Method of Multipliers” (2022), Cells 11(9), 1512.
Fields§
§iterations: usizeNumber of complete passes through the acquisition schedule.
object_step: f64Step size of the linearized, pupil-preconditioned object update.
penalty: f64Positive augmented-Lagrangian penalty tying auxiliary fields to the fields predicted by the shared object.
dual_relaxation: f64Scaled-dual update relaxation in the inclusive range 0..=2.
batch_size: usizeNumber of measured frames supplied to each reconstruction step; the default processes every frame together.
epsilon: f64Positive numerical floor used in normalizations and dark-field handling.
Implementations§
Source§impl Admm
impl Admm
Sourcepub fn iterations(self, iterations: usize) -> Self
pub fn iterations(self, iterations: usize) -> Self
Sets the number of complete acquisition-schedule passes; validation requires non-zero.
Sourcepub fn object_step(self, step: f64) -> Self
pub fn object_step(self, step: f64) -> Self
Sets the finite positive step size for the linearized object update.
Sourcepub fn penalty(self, penalty: f64) -> Self
pub fn penalty(self, penalty: f64) -> Self
Sets the finite positive augmented-Lagrangian consensus penalty.
Sourcepub fn dual_relaxation(self, relaxation: f64) -> Self
pub fn dual_relaxation(self, relaxation: f64) -> Self
Sets finite scaled-dual relaxation in the inclusive interval [0, 2].
Sourcepub fn batch_size(self, batch_size: usize) -> Self
pub fn batch_size(self, batch_size: usize) -> Self
Sets the positive acquisition-frame batch size.
Trait Implementations§
Source§impl ReconstructionAlgorithm for Admm
impl ReconstructionAlgorithm for Admm
Source§type IterationMetrics = AdmmIterationMetrics
type IterationMetrics = AdmmIterationMetrics
Source§fn validate(&self) -> Result<()>
fn validate(&self) -> Result<()>
Source§fn step<M: MeasurementRead>(
&mut self,
problem: &ReconstructionProblem<M>,
state: &mut ReconstructionState,
batch: &Batch,
_iteration: usize,
) -> Result<StepOutput<Self::IterationMetrics>>
fn step<M: MeasurementRead>( &mut self, problem: &ReconstructionProblem<M>, state: &mut ReconstructionState, batch: &Batch, _iteration: usize, ) -> Result<StepOutput<Self::IterationMetrics>>
state for one scheduled batch in zero-based iteration.Source§fn iterations(&self) -> usize
fn iterations(&self) -> usize
Source§fn batch_size(&self) -> usize
fn batch_size(&self) -> usize
Source§fn validate_problem<M: MeasurementRead>(
&self,
_problem: &ReconstructionProblem<M>,
) -> Result<()>
fn validate_problem<M: MeasurementRead>( &self, _problem: &ReconstructionProblem<M>, ) -> Result<()>
problem.Source§fn initialize<M: MeasurementRead>(
&self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionState>
fn initialize<M: MeasurementRead>( &self, problem: &ReconstructionProblem<M>, ) -> Result<ReconstructionState>
problem.Source§fn initialize_with_backend<M: MeasurementRead>(
&self,
problem: &ReconstructionProblem<M>,
backend: Arc<dyn Backend>,
) -> Result<ReconstructionState>
fn initialize_with_backend<M: MeasurementRead>( &self, problem: &ReconstructionProblem<M>, backend: Arc<dyn Backend>, ) -> Result<ReconstructionState>
backend.Source§fn canonicalize_state<M: MeasurementRead>(
&self,
_problem: &ReconstructionProblem<M>,
_state: &mut ReconstructionState,
) -> Result<()>
fn canonicalize_state<M: MeasurementRead>( &self, _problem: &ReconstructionProblem<M>, _state: &mut ReconstructionState, ) -> Result<()>
Source§fn supports_joint_reconstruction(&self) -> bool
fn supports_joint_reconstruction(&self) -> bool
Source§fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionResult>where
Self: Sized,
Source§fn run_with_callbacks<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
callbacks: Vec<Box<dyn Callback>>,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run_with_callbacks<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
callbacks: Vec<Box<dyn Callback>>,
) -> Result<ReconstructionResult>where
Self: Sized,
callbacks at their declared hooks.Source§fn run_from_checkpoint<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
checkpoint: ReconstructionCheckpoint,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run_from_checkpoint<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
checkpoint: ReconstructionCheckpoint,
) -> Result<ReconstructionResult>where
Self: Sized,
problem.Auto Trait Implementations§
impl Freeze for Admm
impl RefUnwindSafe for Admm
impl Send for Admm
impl Sync for Admm
impl Unpin for Admm
impl UnsafeUnpin for Admm
impl UnwindSafe for Admm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more