Start making changes to enable multi-GPU, beginning with simple_ptycho

This commit is contained in:
Abe Levitan committed 2022-10-16 12:01:55 -07:00
1 parent 978c9d3206
commit 1a34aaef60
3 files changed
+49 -49

No files matched your search

+4
View File
@@ -8,10 +8,14 @@ dataset = cdtools.datasets.Ptycho2DDataset.from_cxi(filename)
# Next, we create a ptychography model from the dataset
model = cdtools.models.SimplePtycho.from_dataset(dataset)
model.to(device='cuda:0')
dataset.get_as(device='cuda:0')
# Now, we run a short reconstruction from the dataset!
for loss in model.Adam_optimize(20, dataset):
print(model.report())
print(model.save_results().keys())
# Finally, we plot the results
model.inspect(dataset)
model.compare(dataset)