Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the speed of _compute_3body implementation #283

Merged
merged 15 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better documentation for M3GNet potential training with stresses
  • Loading branch information
kenko911 committed Jun 25, 2024
commit 147d4f565ba078fce2d68b736677cc680ec69b9b
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
" shuffle=True,\n",
" random_state=42,\n",
")\n",
"my_collate_fn = partial(collate_fn_pes, include_line_graph=True)\n",
"# if you are not intended to use stress for training, switch include_stress=False!\n",
"my_collate_fn = partial(collate_fn_pes, include_line_graph=True, include_stress=True)\n",
"train_loader, val_loader, test_loader = MGLDataLoader(\n",
" train_data=train_data,\n",
" val_data=val_data,\n",
Expand All @@ -148,7 +149,8 @@
" element_types=element_types,\n",
" is_intensive=False,\n",
")\n",
"lit_module = PotentialLightningModule(model=model, include_line_graph=True)"
"# if you are not intended to use stress for training, set stress_weight=0.0!\n",
"lit_module = PotentialLightningModule(model=model, include_line_graph=True, stress_weight=0.01)"
]
},
{
Expand Down Expand Up @@ -383,7 +385,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.10.9"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion tests/layers/test_core_and_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_gated_mlp(self, x):

@pytest.mark.parametrize("normalization", ["layer", "graph"])
def test_mlp_norm(self, x, graph, normalization):
layer = MLP_norm(dims=[10, 3], normalization=normalization, normalize_hidden=True)
layer = MLP_norm(dims=[10, 10, 3], normalization=normalization, normalize_hidden=True)
out = layer(x, g=graph).double()
assert [out.size()[0], out.size()[1]] == [4, 3]
assert out.mean().item() == pytest.approx(0, abs=1e-6)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.