mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-11-13 17:53:54 +01:00
Update the docs to include the reconstructors class and discuss their use in the examples
This commit is contained in:
1 parent
3c8de5dc19
commit
8328b852d3
5 files changed
+29
-19
No files matched your search
@@ -19,15 +19,11 @@ device = 'cuda'
|
||||
model.to(device=device)
|
||||
dataset.get_as(device=device)
|
||||
|
||||
# Now, to do the reconstruction we will use the more flexible pattern of
|
||||
# creating an explicit reconstructor. This is what is used behind the
|
||||
# scenes by the convenience functions model.<algorithm>_optimize. For a long
|
||||
# reconstruction script with multiple steps, it is better to create the
|
||||
# reconstructor explicitly.
|
||||
#
|
||||
# The reconstructor will store the model and dataset and create an appropriate
|
||||
# optimizer. This allows the optimizer to persist, along with e.g. estimates
|
||||
# of the moments of individual parameters between loops
|
||||
# For this script, we use a slightly different pattern where we explicitly
|
||||
# create a `Reconstructor` class to orchestrate the reconstruction. The
|
||||
# reconstructor will store the model and dataset and create an appropriate
|
||||
# optimizer. This allows the optimizer to persist between loops, along with
|
||||
# e.g. estimates of the moments of individual parameters
|
||||
recon = cdtools.reconstructors.AdamReconstructor(model, dataset)
|
||||
|
||||
# The learning rate parameter sets the alpha for Adam.
|
||||
|
||||
Reference in new issue
Block a user