Repository navigation
fix for LSQML joint object and probe step sizes - #112
Merged
Merged
Conversation
…ipping of negative steps
mdw771
approved these changes
Nov 18, 2026
Collaborator
There was a problem hiding this comment.
Looks good to me, thanks! Let's keep the default PTYCHOSHELVES for now. In the next release, we will consider changing the default to REAL_LSQ; if it works well, we might just drop the PTYCHOSHELVES branch.
Attaching a list of changes for future reference.
Old · PTYCHOSHELVES
|
New · REAL_LSQ
|
|
|---|---|---|
| Matrix diagonal |
||
| Matrix diagonal |
||
| Upper off-diagonal |
||
| Lower off-diagonal |
||
| Right-hand side | $b_1 = \mbox{Re}(\sum u^\chi)$ and $b_2 = \mbox{Re}(\sum v^\chi)$ | Same |
| Solve | Solve |
Solve |
| Damping | Add 0.1 times each diagonal’s minibatch mean. |
Add 0.02 times each diagonal’s minibatch mean. |
| Zero-direction guard | If a damped diagonal is zero, set it to one. The corresponding step comes out zero. | Same |
| Clipping | Clip each step independently to |
Same |
| Scope and scaling | Solve for one object/probe pair per scan position, then apply the configured step scalers and object normalization. | Same |
Here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features/fixes
The simultaneous step length calculation in LSQML is mathematically incorrect: the matrix element of the 2x2 matrix equation in Eq 22 from the Odstrcil paper can be complex.
See the math in the following notes-to-self, especially Eq 14 for a corrected version of this step length calculation.
I've left the incorrect ptychoshelves version as the default.
lsqml_step_length.pdf
Related issues (optional)
N/A
Mentions
Ming Du
Checklist (Don't skip!)
Have you...