pub struct Fpie {
pub iterations: usize,
pub object_step: f64,
pub stability: f64,
pub batch_size: usize,
pub epsilon: f64,
pub loss_type: LossType,
}Expand description
Regularized ptychographic iterative-engine reconstruction adapted to FPM.
§Method
Fpie performs the same detector-amplitude projection as
super::AlternatingProjection, but preconditions each object correction
with the rPIE denominator
(1 - stability) * |pupil|^2 + stability * max(|pupil|^2). This blends
local inverse-pupil weighting with a global power bound, reducing unstable
updates where the pupil transfer is weak. The corrected low-resolution
spectrum is inserted into the corresponding overlapping patch of the
high-resolution object spectrum.
This crate adapts the rPIE update, originally formulated for scanned ptychography, to image-plane Fourier ptychography.
§Reference
A. Maiden, D. Johnson, and P. Li, “Further improvements to the ptychographical iterative engine” (2017), Optica 4(7), 736–745.
Fields§
§iterations: usizeNumber of complete passes through the acquisition schedule.
object_step: f64Relaxation factor applied to each object-spectrum correction.
stability: f64Blend between local pupil power (0) and maximum pupil power (1) in
the rPIE denominator.
batch_size: usizeNumber of measured frames supplied to each reconstruction step.
epsilon: f64Positive numerical floor added to the rPIE denominator.
loss_type: LossTypeLoss used for diagnostics; the projection itself always enforces the measured amplitude.
Implementations§
Source§impl Fpie
impl Fpie
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 relaxation applied to object-spectrum corrections.
Trait Implementations§
Source§impl ReconstructionAlgorithm for Fpie
impl ReconstructionAlgorithm for Fpie
Source§type IterationMetrics = NoIterationMetrics
type IterationMetrics = NoIterationMetrics
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 Fpie
impl RefUnwindSafe for Fpie
impl Send for Fpie
impl Sync for Fpie
impl Unpin for Fpie
impl UnsafeUnpin for Fpie
impl UnwindSafe for Fpie
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