Skip to content

Commit

Permalink
Merge pull request #96 from diningphil/readme-changelog
Browse files Browse the repository at this point in the history
fixing toml issue
  • Loading branch information
diningphil authored Apr 24, 2024
2 parents 4b3923b + 4162e60 commit b8aedef
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# Changelog

## [1.5.4] New post-processing tutorial
## [1.5.5]

### Fixed

- TOML project to comply with latest releases of `macos` and `coverage` package
- `pydgn-train` and `pydgn-dataset` not being found in version `1.5.4`

## [1.5.4] New post-processing tutorial (yanked)

### Added

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

## [1.5.3] Minor fix

Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,30 @@ To stop the computation, use ``CTRL-C`` to send a ``SIGINT`` signal, and conside
all Ray processes. **Warning:** ``ray stop`` stops **all** ray processes you have launched, including those of other
experiments in progress, if any.

### Using the Trained Models

It's very easy to load the model from the experiments (see also the [Tutorial](https://pydgn.readthedocs.io/en/latest/tutorial.html)):

from pydgn.evaluation.util import *

config = retrieve_best_configuration('RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/MODEL_SELECTION/')
splits_filepath = 'examples/DATA_SPLITS/CHEMICAL/NCI1/NCI1_outer10_inner1.splits'
device = 'cpu'

# instantiate dataset
dataset = instantiate_dataset_from_config(config)

# instantiate model
model = instantiate_model_from_config(config, dataset, config_type="supervised_config")

# load model's checkpoint, assuming the best configuration has been loaded
checkpoint_location = 'RESULTS/supervised_grid_search_toy_NCI1/MODEL_ASSESSMENT/OUTER_FOLD_1/final_run1/best_checkpoint.pth'
load_checkpoint(checkpoint_location, model, device=device)

# you can now call the forward method of your model
y, embeddings = model(dataset[0])


## Projects using PyDGN

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

0 comments on commit b8aedef

Please sign in to comment.