Remove the datset arg from all remaining examples of model.inspect() in the example code

This commit is contained in:
allevitan
2026-06-16 14:24:18 +02:00
parent 8ced842a58
commit 45949534f8
4 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -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);"
]
},
+5 -5
View File
@@ -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);"
]
},
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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()