mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-10 05:22:41 +02:00
Fix a high priority bug with the masking system which was introduced in the switch to reconstructors classes
This commit is contained in:
@@ -190,7 +190,7 @@ class Reconstructor:
|
||||
sim_patterns = self.model.forward(*inp)
|
||||
|
||||
# Calculate the loss
|
||||
if hasattr(self, 'mask'):
|
||||
if hasattr(self.model, 'mask'):
|
||||
loss = self.model.loss(pats,
|
||||
sim_patterns,
|
||||
mask=self.model.mask)
|
||||
|
||||
@@ -52,6 +52,10 @@ def test_lab_ptycho(lab_ptycho_cxi, reconstruction_device, show_plot):
|
||||
print('\nTesting performance on the standard transmission ptycho dataset')
|
||||
dataset = cdtools.datasets.Ptycho2DDataset.from_cxi(lab_ptycho_cxi)
|
||||
|
||||
# Test the masking system
|
||||
dataset.mask[110:115,65:70] = 0
|
||||
dataset.patterns[...,~dataset.mask] = t.max(dataset.patterns)
|
||||
|
||||
model = cdtools.models.FancyPtycho.from_dataset(
|
||||
dataset,
|
||||
n_modes=3,
|
||||
|
||||
Reference in New Issue
Block a user