Repository navigation
Proposed change to propagator normalization #90
mdw771
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposed change to propagator normalization
We are preparing a change to Pty-Chi's propagator normalization and would like feedback before merging it into
main. The change gives all built-in propagators a common intensity convention, but it may affect saved probes, tuned optimization settings, power constraints, and comparisons with previous reconstructions.Under the proposed convention, squared wavefield magnitudes represent counts per pixel. When the diffraction data are in photon counts,
sum(abs(probe)**2)represents incident photons per exposure. Lossless propagation preserves this sum. Physical intensity per unit area can be obtained by dividing the counts per pixel by the pixel area of the corresponding plane.Fourier propagation will use orthonormal FFTs. Fresnel and Fraunhofer propagation will also preserve the discrete intensity sum while retaining their geometry-dependent destination pixel sizes. Angular-spectrum normalization will remain unchanged. Cropping and evanescent filtering can still reduce the collected power.
The following workflows may be affected:
Reusing saved probes. To preserve predicted detector counts with the same object, probes saved under the previous default Fourier convention need an amplitude factor of
sqrt(H*W), whereHandWare the probe dimensions. For a 256×256 probe, this factor is 256. For Fresnel/Fraunhofer probes, the factor issqrt(H*W) * abs(Fr/ar), whereFr = dx²/(λz)andar = dx/dyuse the source-plane pixel pitches. Angular-spectrum probes retain their scale.rescale_proberemains available for initialization from measured data, assuming approximately unit object transmission.Reusing tuned optimization settings. LSQML and PIE-family corrections naturally scale with probe amplitude when used with SGD, so their existing relaxation parameters generally remain appropriate. BH's probe weighting and adaptive optimizers may need adjustment. The conversion depends on which propagator was used previously.
In the table below,
N = H*Wands_F = sqrt(N) * abs(Fr/ar). The Fresnel factors_Fdepends on geometry and can be smaller than one. These conversions assume the probe has been migrated as described above and optimization starts with fresh optimizer state.FourierPropagatorFresnelTransformPropagatorrhosqrt(N)s_Ffor the probe-coordinate conversion; see qualification belows_F**2sqrt(N)s_Fsqrt(N)s_Fs_F**2Ns_F**2if previously specifying probe power before propagation scaling, otherwise unchangedThe different autodiff rules arise because the previous FFT gradient compensation applied only to Fourier propagation. The Fourier conversions reproduced existing reconstruction behavior in our tests. The Fresnel autodiff factors have been checked against the gradients, but full reconstruction validation is still pending. For BH, the Fresnel entry converts the probe-variable weighting; the old implementation also lacked the corresponding Fresnel inverse-to-adjoint gradient correction, so this conversion alone may not reproduce its old trajectory.
This table covers ordinary array-based object and probe variables. OPR, regularization, and other coupled optimization settings may require additional validation. Near-field runs that use
AngularSpectrumPropagatorretain their existing propagation normalization and probe units.LSQML initialization and step sizes. The object preconditioner's initial seed will be the current probe illumination map, with later updates averaging in new illumination maps. The joint step-size solve will use relative damping. With SGD, these rules preserve object values and updates under a change of field units, while probe values and updates scale together. Changing the seed can alter iteration histories relative to version 2.3.0 in both far-field and near-field runs, including angular-spectrum runs whose probe units remain unchanged. Direct preconditioner initialization will take the probe, positions, and optional sampling configuration.
Applying probe-power constraints. The target will have a direct interpretation as incident counts per exposure. Targets expressed in old probe units need conversion by the square of the probe-amplitude factor; targets already intended as incident photon counts can be used directly. Detector totals equal incident counts only under unit transmission and collection over the full propagated grid. Some existing configurations may recover larger object amplitudes because the previous constraint inflated the probe and suppressed the object. For example, our constrained DM reconstructions changed from a maximum object amplitude of about 0.0033 to about 0.84.
Comparing against previous results. A difference in absolute probe or object amplitude may reflect the new units or a corrected power constraint. Changes in optimizer scaling can also affect the reconstruction trajectory. Most tested workflows agree closely after migration; small discrepancies in affine-position LSQML and autodiff OPR are still being investigated.
Calling normalization APIs directly.
FourierPropagatorwill use fixed orthonormal normalization, replacing its configurablenormargument. Theget_intensity_scaling_factorandget_probe_renormalization_factorhelpers, along with the obsolete FFT gradient compensation, will be removed.rescale_probewill use source-plane power by default and accept an optional propagator instance when filtering needs to be evaluated.If your workflow depends on saved probes, calibrated flux or dose, custom propagators, or carefully tuned optimization settings, we would appreciate your comments before this change is merged. Please share any assumptions in your workflow that these changes might affect, whether the migration guidance covers your use case, and any reconstruction differences you observe when trying the
propagator-fixesbranch. Feedback on the proposed convention and API changes is welcome as well.All reactions