mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-09 21:12:42 +02:00
Remove the datset arg from all remaining examples of model.inspect() in the example code
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
"# Workaround reconstruction pattern for interactive plotting in jupyter:\n",
|
||||
"# First, a standalone cell to plot the current model state\n",
|
||||
"\n",
|
||||
"model.inspect(dataset, replot_all=True);"
|
||||
"model.inspect(replot_all=True);"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -96,7 +96,7 @@
|
||||
"source": [
|
||||
"# Save out the results\n",
|
||||
"\n",
|
||||
"model.save_to_h5('lab_ptycho_reconstruction.h5', dataset)"
|
||||
"model.save_to_h5('lab_ptycho_reconstruction.h5');"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -114,7 +114,7 @@
|
||||
"model.tidy_probes()\n",
|
||||
"\n",
|
||||
"# Final plotting\n",
|
||||
"model.inspect(dataset)\n",
|
||||
"model.inspect()\n",
|
||||
"model.compare(dataset);"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
"# Then, create a reconstructor object and view the initialized model\n",
|
||||
"\n",
|
||||
"recon = cdtools.reconstructors.AdamReconstructor(model, dataset)\n",
|
||||
"model.inspect(dataset);"
|
||||
"model.inspect();"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -72,12 +72,12 @@
|
||||
"while model.epoch < 50:\n",
|
||||
" for loss in recon.optimize(1, lr=0.02, batch_size=10):\n",
|
||||
" print(model.report())\n",
|
||||
" model.inspect(dataset, min_interval=10)\n",
|
||||
" model.inspect(min_interval=10)\n",
|
||||
"\n",
|
||||
"while model.epoch < 100:\n",
|
||||
" for loss in recon.optimize(1, lr=0.005, batch_size=10):\n",
|
||||
" print(model.report())\n",
|
||||
" model.inspect(dataset, min_interval=10)"
|
||||
" model.inspect(min_interval=10)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -89,7 +89,7 @@
|
||||
"source": [
|
||||
"# Save out the results\n",
|
||||
"\n",
|
||||
"model.save_to_h5('lab_ptycho_reconstruction.h5', dataset)"
|
||||
"model.save_to_h5('lab_ptycho_reconstruction.h5')"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -107,7 +107,7 @@
|
||||
"model.tidy_probes()\n",
|
||||
"\n",
|
||||
"# Final plotting\n",
|
||||
"model.inspect(dataset)\n",
|
||||
"model.inspect()\n",
|
||||
"model.compare(dataset);"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ if t.cuda.is_available():
|
||||
model.to(device='cuda')
|
||||
dataset.get_as(device='cuda')
|
||||
|
||||
model.inspect(dataset)
|
||||
model.inspect()
|
||||
|
||||
# We run the reconstruction
|
||||
for loss in model.Adam_optimize(100, dataset, batch_size=10):
|
||||
|
||||
@@ -20,6 +20,6 @@ for loss in model.Adam_optimize(10, dataset):
|
||||
model.inspect()
|
||||
print(model.report())
|
||||
|
||||
model.inspect(dataset)
|
||||
model.inspect()
|
||||
model.compare(dataset)
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user