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

🌟 [FEATURE] Masking out some labels (e.g. constrained atoms) #307

Open
Linux-cpp-lisp opened this issue Feb 21, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@Linux-cpp-lisp
Copy link
Collaborator

BETA implemention on masks: https://github.com/mir-group/nequip/tree/masks/examples/mask_labels

See #240 for more discussion.

@Linux-cpp-lisp Linux-cpp-lisp added the enhancement New feature or request label Feb 21, 2023
@Linux-cpp-lisp Linux-cpp-lisp changed the title 🌟 [FEATURE] Masking out some labels (constrained atoms) 🌟 [FEATURE] Masking out some labels (e.g. constrained atoms) Feb 21, 2023
@mhellstr
Copy link

A related feature request would be to set custom weights per force component (e.g. as additional columns in an ASE .xyz dataset).

If I have structures where some atoms have very large forces I do not really care how accurate the trained model is on those large forces, only that they are "large", so it would be great to be able to give them a much smaller weight in the loss function.

This would be useful for example when adding short interatomic distances, or when breaking chemical bonds (i.e. far from equilibrium).

@Linux-cpp-lisp
Copy link
Collaborator Author

Hi @mhellstr ,

That would be something you'd implement as a custom loss function, see here:
https://github.com/mir-group/nequip-example-extension

You could either make a custom loss that directly depends on the force magnitude, or you could take a force_weights (or whatever) key from the data and use that to reweight the loss value. (In the second case, you'd just need to include the force_weights in the dataset as a custom field with include_keys)

@Zausinator
Copy link

Hi,
Super cool, I would love to also use this feature in my work!
Is it possible to also set the masked atom's atomic energy contribution to zero? Ideally I would like to keep the masked atoms in the structure to keep the local atomic environment of the relevant atoms intact, however I do not want them contributing to the ultimage energy of the structure.
I tried by including the value "atomic_energy" in the field fields_to_mask, but that didn't work, presumably because the training data only includes one scalar value for the total_energy.
Is there anyway around this?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants