diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 53ab81a..6f6bd0a 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -13,7 +13,7 @@ It is recommended that you clone the repository, rather than just downloading th Step 2: Install Dependencies ---------------------------- -The dependencies for CDTools can be installed, if you are managing your environment with anaconda, by running +The dependencies for CDTools can be installed, if you are managing your environment with anaconda, by running the following command in the top level directory of the package: .. code:: bash diff --git a/examples/simple_ptycho_model.py b/examples/simple_ptycho_model.py index ca51d3d..012af2c 100644 --- a/examples/simple_ptycho_model.py +++ b/examples/simple_ptycho_model.py @@ -105,3 +105,23 @@ class SimplePtycho(CDIModel): if __name__ == '__main__': + from basic_ptycho_dataset import BasicPtychoDataset + from h5py import File + from matplotlib import pyplot as plt + + filename = 'example_data/lab_ptycho_data.cxi' + with File(filename, 'r') as f: + dataset = BasicPtychoDataset.from_cxi(f) + + + model = SimplePtycho.from_dataset(dataset) + + #model.to(device='cuda') + #dataset.get_as(device='cuda') + + for i, loss in enumerate(model.Adam_optimize(100, dataset)): + model.inspect(dataset) + print(i,loss) + + model.compare(dataset) + plt.show()