Add loss function coverage to slow reconstruction tests

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>
This commit is contained in:
allevitan
2026-04-03 18:45:29 +02:00
co-authored by Claude Sonnet 4.6
parent d644782e94
commit 178e9a4e4e
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -138,7 +138,11 @@ def test_near_field_ptycho(near_field_ptycho_cxi, reconstruction_device, show_pl
n_modes=1,
near_field=True,
propagation_distance=3.65e-3, # 3.65 downstream from focus
<<<<<<< HEAD
panel_plot_mode=False, # test without panel plot mode
=======
loss='poisson_nll',
>>>>>>> f0f1577 (Add loss function coverage to slow reconstruction tests)
)
print('Running reconstruction on provided reconstruction_device,',
+4
View File
@@ -38,7 +38,11 @@ def test_Adam_gold_balls(gold_ball_cxi, reconstruction_device, show_plot):
propagation_distance=2e-6,
units='um',
probe_fourier_crop=pad,
<<<<<<< HEAD
panel_plot_mode=False, # At least one check without panel plot mode
=======
loss='intensity_mse',#NOTE: Only to check that it works.
>>>>>>> f0f1577 (Add loss function coverage to slow reconstruction tests)
)
model.translation_offsets.data += 0.7 * \