Closed RasmusOrsoe closed 1 year ago
Yesss! 👏 I think this is a brilliant initiative that ties in with #226, #175, and more. And thanks for the conceptual code — I think it is the right thing to do to start from "what would we ideally like the code to look like" and then work backwards from there.
Cool! I think it could become quite elegant if we use the model as a "vechicle" for the auxiliary data, such as batch_size, epochs, etc. This way, we also ensure it's actually saved with the model.
@RasmusOrsoe, do I remember correctly that you had some ideas for this (scikit-learn-ish)?
@asogaard yes. I have not had the time to actually begin working on it, but I wanted to do something, such that a MWE of training could be boiled down to:
import graphnet
from graphnet.shelf import DynEdge # user friendly, pre-configured model class that reconstructs / classifies several targets ("on the shelf") - training loop, prediction loop etc. is all pre-defined via new code
from graphnet.plotting import resolution_plots
dataset = graphnet.dataset.low_energy('path_to_download_dataset') # ala https://pytorch.org/vision/stable/datasets.html
trained_model = DynEdge.fit(dataset.train)
my_predictions = DynEdge.predict(dataset.test)
my_resolution_figure = resolution_plots(my_predictions)
Alright, I can start having a look!
Please feel free to! I would love to chip in, but I'm afraid it will be some time before I can give this a go.
In
/examples/train_model.py
the MWE of a training script is 150 lines of code. If we introduce a default configuration for each model (model.config
), aSession
class we could simplify this greatly. Here is a bit of conceptual code