mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-12-01 01:07:46 +01:00
Add sim-to-dataset capability
This commit is contained in:
1 parent
f769f9e7ab
commit
a2a07055c4
3 files changed
+61
-3
No files matched your search
@@ -11,9 +11,11 @@ filename = 'example_data/AuBalls_700ms_30nmStep_3_6SS_filter.cxi'
|
||||
with h5py.File(filename,'r') as f:
|
||||
dataset = CDTools.datasets.Ptycho_2D_Dataset.from_cxi(f)
|
||||
|
||||
|
||||
model = CDTools.models.FancyPtycho.from_dataset(dataset,n_modes=3,randomize_ang=0.1*np.pi)
|
||||
|
||||
|
||||
|
||||
# default is CPU with 32-bit floats
|
||||
model.to(device='cuda')
|
||||
dataset.get_as(device='cuda')
|
||||
@@ -24,7 +26,8 @@ for i, loss in enumerate(model.Adam_optimize(3, dataset, batch_size=100)):
|
||||
print(i,loss)
|
||||
|
||||
|
||||
#with open('test_results.pickle', 'wb') as f:
|
||||
|
||||
#with open('example_reconstructions/Au_balls.pickle', 'wb') as f:
|
||||
# pickle.dump(model.save_results(dataset),f)
|
||||
|
||||
model.inspect(dataset)
|
||||
|
||||
Reference in new issue
Block a user