Skip to content

Conversation

@a4894z
Copy link
Collaborator

@a4894z a4894z commented Nov 21, 2024

In FoldSlice, when computing LSTSQ multislice steplengths (using either the joint probe/object steplength computation or the non-joint), they divide the computed object step length by the number of slices and the number of probe modes.

I include this scaling in LSTSQ multislice for this pull request.

@a4894z a4894z requested a review from mdw771 November 21, 2024 18:26
If True, object and probe step sizes will only be calculated using the first probe mode.
"""

beta_LSQ: float = 0.9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step_size already does this so we don't need a separate parameter. I will revert this.

@mdw771 mdw771 force-pushed the object_step_scaling_as_in_foldslice branch from e65f542 to 001ef2e Compare December 11, 2024 16:18
@mdw771
Copy link
Collaborator

mdw771 commented Dec 11, 2024

Changes

Changes are made to match PtychoShelves in the following discrepancies found between the two packages:

Item Matched/fixed?
Initialize probe modes using Hermite polynomials. Y
Normalize probe magnitudes using max power of DPs. Y
Always regenerate secondary incoherent modes and OPR eigenmodes even when initial probe is given N
Auto center probe Y
Far-field propagator FFT uses "forward" instead of "ortho" Y
Scale probe magnitude by 1/sqrt(N) to compensate for FFT factor N
Orthogonalize incoherent modes at the beginning Y
Only correct probe intensity scaling during the first epoch Y
Build object preconditioner with only the principal mode and divide preconditioner by 2 Y
Calculate object step size with only the principal probe mode; use psi_{i-1} for intermediate slices (Pty-Chi had a mistake) Y
Calculate probe step size using preconditioned probe update Y
Pty-Chi has a mistake in mode slicing in variable probe update Y
Pty-Chi has a mistake in calculating the projection of the probe update residue to the current eigenmode Y
Pty-Chi has a mistake where the chi used for OPR mode/weight update is modulated by the object Y
Optional multimodal update; if false, calculate object update with only probe mode 1; if true, use all the modes, and scale object step size by the number of probe modes Y
Momentum acceleration uses Fourier error to determine whether to apply momentum or not Y
Pty-Chi has a mistake in correlation calculation for momentum acceleration where the norm wasn't calculated correctly Y

For the most updated list of discrepancies, see https://git.aps.anl.gov/ptycho_software/pty-chi/-/issues/32.

API changes

  • LSQMLReconstructorOptions.solve_step_sizes_only_using_first_probe_mode default changed to True
  • LSQMLReconstructorOptions.momentum_acceleration_gain added
  • LSQMLObjectOptions.solved_step_size_upper_bound removed
  • LSQMLObjectOptions.optimal_step_size_scaler added
  • LSQMLObjectOptions.multimodal_update added
  • LSQMLProbeOptions.solved_step_size_upper_bound removed
  • LSQMLProbeOptions.optimal_step_size_scaler added
  • LSQMLProbeOptions.eigenmode_update_relaxation default changed to 1.0 (was 0.1)
  • LSQMLOPRModeWeightsOptions.update_relaxation default changed to 1.0 (was 0.1)

@mdw771 mdw771 merged commit 7c452a2 into main Dec 11, 2024
1 check passed
@a4894z a4894z deleted the object_step_scaling_as_in_foldslice branch December 16, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants