Skip to content

Commit

Permalink
Update Training a M3GNet Formation Energy Model with PyTorch Lightnin…
Browse files Browse the repository at this point in the history
…g.ipynb

Convert collate_fn into collate_fn_graph for structure-wise property prediction.

Signed-off-by: Tsz Wai Ko <[email protected]>
  • Loading branch information
kenko911 authored Jul 26, 2024
1 parent 4c980c6 commit b3ba4e7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"from tqdm import tqdm\n",
"\n",
"from matgl.ext.pymatgen import Structure2Graph, get_element_list\n",
"from matgl.graph.data import MGLDataset, MGLDataLoader, collate_fn\n",
"from matgl.graph.data import MGLDataset, MGLDataLoader, collate_fn_graph\n",
"from matgl.models import M3GNet\n",
"from matgl.utils.io import RemoteFile\n",
"from matgl.utils.training import ModelLightningModule\n",
Expand Down Expand Up @@ -156,7 +156,7 @@
" shuffle=True,\n",
" random_state=42,\n",
")\n",
"my_collate_fn = partial(collate_fn, include_line_graph=True)\n",
"my_collate_fn = partial(collate_fn_graph, include_line_graph=True)\n",
"train_loader, val_loader, test_loader = MGLDataLoader(\n",
" train_data=train_data,\n",
" val_data=val_data,\n",
Expand Down

0 comments on commit b3ba4e7

Please sign in to comment.