Repository navigation
Two-page white paper for high-throughput screening deployment - #596
Open
talonchandler wants to merge 4 commits into
Open
talonchandler wants to merge 4 commits into
talonchandler wants to merge 4 commits into
Conversation
Bare 'auto' resolves the in-focus slice with a discrete per-slice search
over 3D reconstructions of several structured crops (median across crops),
matching the OPS production autofocus. '{init: auto, lr: ...}' seeds the
gradient optimizer with the searched value for sub-slice co-optimization
with tilt angles. The resolved value is frozen into a sibling
*_autofocus.yml config for auditability.
Also fix the optimization path to differentiate the same SVD-based
reconstruction it returns: the norm-based surrogate (previously forced
whenever gradients were enabled) drops absorption/phase coupling and its
gradients disagree with the true loss landscape, stalling tilt and focus
fits. The surrogate now remains only as a CUDA fallback where complex SVD
backward is unreliable.
Two-page case study on OPS atlas data: acquisition settings (Koehler, condenser NA, z spacing), a one-config reconstruction with z_focus_offset: auto, and four boxed failure modes with their fixes (flipped z axis, incorrect regularization, autofocus drift, well-edge illumination tilt). The folder is self-contained: the docs-site page (labelfree-screening.md, wired into the guide toctree), the 2-page whitepaper (whitepaper.tex + whitepaper.pdf, built by make_pdf.sh with base texlive), vector and raster figures with their generator (figures/make_figures.py, runs on the Biohub HPC against the atlas data), and the configs the tutorial teaches.
talonchandler
marked this pull request as ready for review
November 14, 2026 00:05
last_good was saved after optimizer.step(), so it held unvalidated parameter values. A degenerate SVD gradient can step parameters to non-finite values; those were checkpointed, the next iteration's reconstruction raised, the loop rolled back to the same bad values, and the final reconstruction crashed with linalg.svd non-finite errors. Checkpoint the values that produced the validated loss instead, and fail fast when a step produces non-finite parameters.
torch.linalg.svd backward produces non-finite gradients where singular values are degenerate, which is ubiquitous beyond the band limit; one bad step then poisons the optimization (seen as CI failures in test_optimization_cli). Replace the gradient-mode path with a closed-form eigendecomposition of the 2x2 Gram matrix: the same decomposition as the SVD up to gauge (reconstructions agree; regression-tested), with relative-epsilon smoothing so gradients stay finite at degeneracies, and working on all devices including CUDA.
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.
z_focus_offset: auto, an autofocus algorith matching the OPS production approach (MBSF from 3D phase recon).figures/make_figures.pyregenerates the figures on the Biohub HPC,make_pdf.shbuilds the PDF fromwhitepaper.tex, and the configs shown in the tutorial are included.