Skip to content

Commit b8aedef

Browse files
authored
Merge pull request #96 from diningphil/readme-changelog
fixing toml issue
2 parents 4b3923b + 4162e60 commit b8aedef

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Changelog
22

3-
## [1.5.4] New post-processing tutorial
3+
## [1.5.5]
4+
5+
### Fixed
6+
7+
- TOML project to comply with latest releases of `macos` and `coverage` package
8+
- `pydgn-train` and `pydgn-dataset` not being found in version `1.5.4`
9+
10+
## [1.5.4] New post-processing tutorial (yanked)
411

512
### Added
613

7-
- TODO
14+
- Utilities to load model, dataset, data providers, and checkpoints from the experiments folder
15+
- Tutorials on README and documentation on how to use them.
816

917
## [1.5.3] Minor fix
1018

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ To stop the computation, use ``CTRL-C`` to send a ``SIGINT`` signal, and conside
6565
all Ray processes. **Warning:** ``ray stop`` stops **all** ray processes you have launched, including those of other
6666
experiments in progress, if any.
6767

68+
### Using the Trained Models
69+
70+
It's very easy to load the model from the experiments (see also the [Tutorial](https://pydgn.readthedocs.io/en/latest/tutorial.html)):
71+
72+
from pydgn.evaluation.util import *
73+
74+
config = retrieve_best_configuration('RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/MODEL_SELECTION/')
75+
splits_filepath = 'examples/DATA_SPLITS/CHEMICAL/NCI1/NCI1_outer10_inner1.splits'
76+
device = 'cpu'
77+
78+
# instantiate dataset
79+
dataset = instantiate_dataset_from_config(config)
80+
81+
# instantiate model
82+
model = instantiate_model_from_config(config, dataset, config_type="supervised_config")
83+
84+
# load model's checkpoint, assuming the best configuration has been loaded
85+
checkpoint_location = 'RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/final_run1/best_checkpoint.pth'
86+
load_checkpoint(checkpoint_location, model, device=device)
87+
88+
# you can now call the forward method of your model
89+
y, embeddings = model(dataset[0])
90+
91+
6892
## Projects using PyDGN
6993

7094
- [Infinite Contextual Graph Markov Model (ICML 2022)](https://github.com/diningphil/iCGMM)

0 commit comments

Comments
 (0)