pub struct AdaptiveAlternatingProjection {
pub iterations: usize,
pub initial_object_step: f64,
pub progress_threshold: f64,
pub reduction_factor: f64,
pub minimum_object_step: f64,
pub batch_size: usize,
pub epsilon: f64,
}Expand description
Noise-robust alternating projection with a pass-adaptive object step.
§Method
The per-frame update is the same fixed-pupil amplitude projection used by
super::AlternatingProjection. One relaxation factor is shared by every
frame in a complete acquisition-schedule pass. The algorithm accumulates
the mask-aware, frame-weighted amplitude-MSE objective already evaluated by
those projections. After two completed passes establish consecutive
objectives, it retains the step when relative progress is greater than
progress_threshold; otherwise it multiplies the step by
reduction_factor, without going below minimum_object_step.
This feedback rule does not retry or roll back an iteration. Its objective
is the inexpensive incremental approximation described by Zuo et al., not
an additional exact full-data evaluation. The current step, preceding
objective, partial objective sums, and controller parameters are stored in
ReconstructionState so a matching checkpoint resumes exactly. Batching
cannot change the numerical path, while changing the acquisition schedule
intentionally can.
§Assumptions and limitations
The algorithm recovers only the object and keeps the compiled pupil fixed. Its feedback objective is always amplitude MSE so a reporting option cannot silently change controller behavior. It cannot be nested in physical joint calibration because recompiling the forward model changes the meaning of its objective history. The convergence analysis in the cited work assumes convex component objectives; Fourier-ptychographic phase retrieval is non-convex, so the adaptive rule is a practical robustness strategy rather than a global-convergence guarantee.
§References
C. Zuo, J. Sun, and Q. Chen, “Adaptive step-size strategy for noise-robust Fourier ptychographic microscopy” (2016), Optics Express 24(18), 20724–20744.
Fields§
§iterations: usizeNumber of complete passes through the acquisition schedule.
initial_object_step: f64Object relaxation used until the feedback rule first reduces it.
progress_threshold: f64Minimum relative objective decrease required to retain the current step.
reduction_factor: f64Multiplicative step reduction used when progress is insufficient.
minimum_object_step: f64Positive lower bound on the adaptive object step.
batch_size: usizeNumber of measured frames supplied to each reconstruction step.
epsilon: f64Positive numerical floor used in projection divisions and relative progress.
Implementations§
Source§impl AdaptiveAlternatingProjection
impl AdaptiveAlternatingProjection
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 initial_object_step(self, initial_object_step: f64) -> Self
pub fn initial_object_step(self, initial_object_step: f64) -> Self
Sets the finite positive initial object-projection relaxation.
Sourcepub fn progress_threshold(self, progress_threshold: f64) -> Self
pub fn progress_threshold(self, progress_threshold: f64) -> Self
Sets the required relative progress; validation requires [0, 1).
Sourcepub fn reduction_factor(self, reduction_factor: f64) -> Self
pub fn reduction_factor(self, reduction_factor: f64) -> Self
Sets the multiplicative reduction; validation requires (0, 1).
Sourcepub fn minimum_object_step(self, minimum_object_step: f64) -> Self
pub fn minimum_object_step(self, minimum_object_step: f64) -> Self
Sets the finite positive step floor, no greater than the initial step.
Sourcepub fn batch_size(self, batch_size: usize) -> Self
pub fn batch_size(self, batch_size: usize) -> Self
Sets the positive number of acquisition frames supplied per step.
Trait Implementations§
Source§impl Clone for AdaptiveAlternatingProjection
impl Clone for AdaptiveAlternatingProjection
Source§fn clone(&self) -> AdaptiveAlternatingProjection
fn clone(&self) -> AdaptiveAlternatingProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ReconstructionAlgorithm for AdaptiveAlternatingProjection
impl ReconstructionAlgorithm for AdaptiveAlternatingProjection
Source§type IterationMetrics = AdaptiveAlternatingProjectionIterationMetrics
type IterationMetrics = AdaptiveAlternatingProjectionIterationMetrics
Source§fn validate(&self) -> Result<()>
fn validate(&self) -> Result<()>
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 supports_joint_reconstruction(&self) -> bool
fn supports_joint_reconstruction(&self) -> bool
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 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 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 AdaptiveAlternatingProjection
impl RefUnwindSafe for AdaptiveAlternatingProjection
impl Send for AdaptiveAlternatingProjection
impl Sync for AdaptiveAlternatingProjection
impl Unpin for AdaptiveAlternatingProjection
impl UnsafeUnpin for AdaptiveAlternatingProjection
impl UnwindSafe for AdaptiveAlternatingProjection
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