- Revert test_Adam_gold_balls to default amplitude_mse
- Add new test_intensity_MSE test (gold balls + AdamReconstructor)
- Update near_field threshold to 17 (poisson_nll scale)
Thresholds for test_intensity_MSE to be tuned after GPU run.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use poisson_nll in test_near_field_ptycho and intensity_mse in
test_Adam_gold_balls to exercise these loss paths end-to-end.
Thresholds left as-is pending re-running on a GPU machine.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
poisson_nll now returns a sum rather than a mean, consistent with the
normalizer pattern. Remove the per-pixel divisions from the numpy
reference calculations accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates tutorial_simple_ptycho.py to match simple_ptycho.py: removes
the def loss() method and instead assigns self.loss and
self.loss_normalizer as instance attributes in __init__.
Updates tutorial.rst accordingly: adds the loss assignment to the
__init__ code block with an explanation, and removes def loss() from
the forward model section.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds 'intensity_mse' as a selectable loss function (alongside the
existing 'amplitude_mse' and 'poisson_nll') to FancyPtycho,
MultislicePtycho, Bragg2DPtycho, Multislice2DPtycho, and RPI.
Models that previously had a hardcoded amplitude_mse assignment now
use the same configurable pattern as FancyPtycho, with the loss
parameter threaded through from_dataset and from_calibration as well.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enables versioned documentation on ReadTheDocs. Installs the package
with its docs extras (sphinx, sphinx-rtd-theme, sphinx-argparse) so
autodoc can import cdtools during the build.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All public functions in plotting.py now use the expanded multi-line
signature format with trailing commas for consistency and readability.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add title parameter to plot_image, plot_real, plot_imag, plot_amplitude,
plot_phase, and plot_colorized
- Various fixes to base.py and fancy_ptycho.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Switch panel plots to use subfigures with constrained_layout for better layout management
- Add plot_loss_history method to CDIModel base class
- Fix matplotlib compatibility for older versions (interactive backend detection)
- Make CUDA usage conditional in examples
- Add panel_plot_mode and plot_level params to FancyPtycho constructor
- Default plot_level filtering to 1 instead of 0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>