pub struct GradientDescent {Show 16 fields
pub iterations: usize,
pub object_step: f64,
pub batch_size: usize,
pub epsilon: f64,
pub loss_type: LossType,
pub recover_illumination: bool,
pub illumination_step: f64,
pub illumination_finite_difference: f64,
pub maximum_illumination_correction: f64,
pub recover_pupil: bool,
pub pupil_step: f64,
pub constrain_pupil_support: bool,
pub object_tv_weight: f64,
pub object_tv_epsilon: f64,
pub pupil_smoothing_weight: f64,
pub parallel_workers: usize,
}Expand description
Wirtinger-style loss-gradient reconstruction for Fourier ptychography.
§Method
The solver differentiates a selected real-valued data loss through the complex FPM forward model, accumulates gradients from a mini-batch, and applies a pupil-power-preconditioned update to the shared object spectrum. This is the Fourier-ptychographic Wirtinger-flow viewpoint: phase retrieval is treated as direct optimization rather than alternating hard projections. Losses are evaluated after accounting for known linear gain and background, so detector count scaling does not change the intrinsic update scale.
Optional extensions recover the pupil with an analogous normalized gradient, estimate illumination offsets with finite-difference derivatives and diagonal Gauss–Newton scaling, and regularize the complex object or pupil. Incoherent multiplexing, these calibration updates, and the selectable losses extend the reference formulation.
§Reference
L. Bian, J. Suo, G. Zheng, K. Guo, F. Chen, and Q. Dai, “Fourier ptychographic reconstruction using Wirtinger flow optimization,” Optics Express 23(4), 4856–4866 (2015), doi:10.1364/OE.23.004856.
Fields§
§iterations: usizeNumber of complete passes through the acquisition schedule.
object_step: f64Step size of the pupil-power-preconditioned object update.
batch_size: usizeNumber of frame gradients averaged into one update.
epsilon: f64Positive numerical floor used by losses and preconditioners.
loss_type: LossTypeData-fidelity objective to differentiate and report.
recover_illumination: boolWhether to estimate a Fourier-grid offset for every illumination source.
illumination_step: f64Step size of the diagonally scaled illumination-offset update.
illumination_finite_difference: f64Central finite-difference spacing in Fourier-grid pixels.
maximum_illumination_correction: f64Maximum absolute row or column correction, in Fourier-grid pixels.
recover_pupil: boolWhether to update the complex pupil alongside the object.
pupil_step: f64Step size of the normalized pupil update.
constrain_pupil_support: boolWhether to zero recovered pupil values outside the compiled aperture.
object_tv_weight: f64Weight of the isotropic total-variation step on the complex object;
0 disables it.
object_tv_epsilon: f64Positive smoothing constant in the differentiable TV norm.
pupil_smoothing_weight: f64Weight of quadratic nearest-neighbor pupil smoothing; 0 disables it
and positive values require pupil recovery.
parallel_workers: usizeMaximum number of frame-gradient worker threads.
Implementations§
Source§impl GradientDescent
impl GradientDescent
pub fn iterations(self, iterations: usize) -> Self
pub fn object_step(self, step: f64) -> Self
pub fn batch_size(self, batch_size: usize) -> Self
pub fn loss_type(self, loss_type: LossType) -> Self
pub fn recover_illumination(self, recover: bool) -> Self
pub fn illumination_step(self, step: f64) -> Self
pub fn illumination_finite_difference(self, distance: f64) -> Self
pub fn illumination_bounds(self, maximum_absolute_correction: f64) -> Self
pub fn recover_pupil(self, recover: bool) -> Self
pub fn pupil_step(self, step: f64) -> Self
pub fn constrain_pupil_support(self, constrain: bool) -> Self
pub fn object_tv(self, weight: f64) -> Self
pub fn object_tv_epsilon(self, epsilon: f64) -> Self
pub fn pupil_smoothing(self, weight: f64) -> Self
Sourcepub fn parallel_workers(self, workers: usize) -> Self
pub fn parallel_workers(self, workers: usize) -> Self
Sets the maximum number of frame-gradient workers. Object, pupil, and illumination-calibration contributions are reduced deterministically.
Trait Implementations§
Source§impl Clone for GradientDescent
impl Clone for GradientDescent
Source§fn clone(&self) -> GradientDescent
fn clone(&self) -> GradientDescent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more