Save InteractionGNN2 to Torch Script
This MR is to update those Neural Networks used in Example_1 and Example_2 so that they can be saved to TorchScript format through the script scripts/save_full_model.py
.
One can run the following to perform the conversion for various models.
python scripts/save_full_model.py gnn_train.yaml
where the gnn_train.yaml
is the training configuration.
Summary of the changes:
- Add two notebooks for
- testing the feasibility of converting
torch_geometric
aggregation functions toTorchScript
orONNX
, - testing the feasibility of converting
nn.Module
toTorchScript
.
- testing the feasibility of converting
- Add the
black
version to therequirements.txt
, because CI uses a specific version ofblack==22.8.0
and the results of theblack --check .
changes when the latestblack
version (24.3.0) is used. - Move the "input preparations" part (like stacking node features) from the
training_step
and other places inLightningModule
todef get(self, idx)
in theDataset
.
Follow-up developments/issues: #83 (closed) , #84 (closed).
Edited by Xiangyang Ju