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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in scripted SOAP-BPNN without LayerNorm #166

Merged
merged 3 commits into from
Apr 4, 2024

Conversation

frostedoyster
Copy link
Collaborator

@frostedoyster frostedoyster commented Apr 4, 2024

At the moment, we're using torch.nn.Identity instead of our LayerNorm if LayerNorm is disabled. This is fine, however, the torchscripted version of torch.nn.Identity only accepts torch.Tensors, and not other objects


馃摎 Documentation preview 馃摎: https://metatensor-models--166.org.readthedocs.build/en/166/

Comment on lines +26 to +29
system = ase.Atoms(
"OHCN",
positions=[[0.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, 2.0], [0.0, 0.0, 3.0]],
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

system = System(
   species=torch.tensor([8, 1, 6, 7],
   positions=torch.tensor([[0.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, 2.0], [0.0, 0.0, 3.0]])
   cell=torch.zeros((3, 3)),
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it looks fine since all the other tests also take in systems from ase.Atoms, but if it's a matter of dropping more dependencies for the test, then I'm for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened issue

Copy link
Contributor

@SanggyuChong SanggyuChong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we did the same hot fix in llpr branch so we know it gets the job done. Leaving only a comment so that @frostedoyster has time to make adjustments to the test script as needed.

Comment on lines +26 to +29
system = ase.Atoms(
"OHCN",
positions=[[0.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, 0.0, 2.0], [0.0, 0.0, 3.0]],
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me it looks fine since all the other tests also take in systems from ase.Atoms, but if it's a matter of dropping more dependencies for the test, then I'm for it.

@frostedoyster frostedoyster merged commit 0fb52b9 into main Apr 4, 2024
11 checks passed
@frostedoyster frostedoyster deleted the soap-bpnn-identity-bug branch April 4, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants