graphnet icon indicating copy to clipboard operation
graphnet copied to clipboard

Add example directory and example scripts of using a pretrained model

Open AMHermansen opened this issue 2 years ago • 2 comments

With the introduction of #567 we now have pretrained models in the library. But we don't have any examples showing how they might be used for inference. I think creating a new directory examples/06_pretrained and adding some example scripts for various use cases of using pretrained models.

Some use-cases that come to mind

  1. Predicting on a dataset with/without config files.
  2. Benchmarking multiple models against one another on the same dataset.
  3. Downstream training. (Freezing the gnn-part, but replacing the task/final MLP (this might not be possible in the current GraphNeT and might deserve it's own issue)).

AMHermansen avatar Sep 06 '23 07:09 AMHermansen

@AMHermansen We do indeed have examples on how to use them for inference; but that is in deployment on i3 files. Are you looking for examples on how to load a pre-trained model and apply it to a graphnet dataset? If so, we could just modify the current training script that uses config files; the only difference is loading the state dict.

RasmusOrsoe avatar Sep 06 '23 12:09 RasmusOrsoe

I was looking for how to apply it to a GraphNeT dataset, I know it shouldn't be too difficult to do, I'm just rather unsure about what can be added in a training script, without breaking what is logged. (Will a model log that I'm using pre-trained weights for example).

AMHermansen avatar Sep 11 '23 08:09 AMHermansen