Repository navigation
Features
- Added shared detector gain and offset maps through
PtychographyTask(..., detector_response_map=(gain, offset)). The forward
model appliesintensity * gain + offsetafter detector cropping and blur.
Supply maps in the same pixel ordering as the input diffraction patterns;
the task applies the configured FFT shift to both. - Added optional detector-response refinement through
ForwardModelOptions.detector_response_options. Analytical reconstructors
fit intensity least squares once per enabled epoch; autodiff uses its
configured loss and minibatch optimizer. Refinement is disabled by default.
When enabled, it updates offsets by default; gain refinement is opt-in and
normalizes the mean gain while rescaling the probe to preserve predicted
measurements. Retrieve the maps withtask.get_data("detector_response"). - Added automatic optimizer closures, including LBFGS support, for parameters
updated through optimizers in AD, LSQML, PIE, BH, DM, and RAAR.
OptimizerClosureModeslets custom optimizers request loss-only or
loss-and-gradient evaluations. Custom closures can also be supplied per
parameter or per step. Automatic closures currently support single-process
execution; supported parameters depend on the reconstruction algorithm.
Fixes and performance
- Corrected detector-crop adjoints for mixed odd/even grid sizes and the
transpose of Gaussian blur with replicated-edge padding. LSQML reciprocal-space
steps now account for detector cropping and blur. - Reduced memory use when shifting all incoherent probe modes by broadcasting
Fourier and periodic cubic shift multipliers across modes. This avoids
repeated multipliers for modes sharing the same scan position.
Documentation and validation
- Added guides for custom forward models and reconstruction parameters in AD,
optimizer closures, and detector-response maps and refinement. - Expanded regression coverage for detector-response refinement, detector
adjoints, optimizer closures, and multimode shift values and gradients. - Lint and GPU tests passed for release commit
2f757efb49217906e2b4b7692d65471a41257955. The source distribution and wheel
built as version 2.5.0 and passed Twine metadata checks.
Full changelog: v2.4.0...v2.5.0