Replies: 7 comments 7 replies
-
Hi @tgmaxson , You'll have to clarify what you mean by "not included in the model"--- do you want to omit them from the input? Made predictions on them but not train on them? Etc. |
Beta Was this translation helpful? Give feedback.
-
I would like to not train on them and there is no real reason to make predictions on them either (they will be 0,0,0 in force). Omitting them from the total energy/stress should also be fine since they will remain constant. However, they need to be there for the other atoms. To give a more complete context, this is something like a FCC111 surface with 2 layers constrained at the bottom and 2 layers relaxed. What are the relevant tags for this or am I overthinking this and they should just stay in the model? |
Beta Was this translation helpful? Give feedback.
-
In general I have understood constrained atoms to be zeros in velocity (as in, you don't time integrate them), but not zero in force. (Though obviously you could enforce zero velocity by setting forces to zero.) I definitely agree that if in your data the forces are fake zeros then you should not train on that, since it will screw everything up 😁 If those atoms have real forces in your original data, it doesn't matter whether they are constrained or not and you can just use that as more data-- don't have to do anything different. NequIP does suppor this: It's not something I've worked with recently but basically if you provide |
Beta Was this translation helpful? Give feedback.
-
To set the target/truth value I simply need to set the values to NaN then right? It would be great if there was a way in NEQUIP to do this automagically. To be clear, just set the force values in the supplied dataset to NaN. Constraints do typically mean zero velocity for MD / optimization but typically codes such as VASP will report it as (0, 0, 0) in force as well. It's not ideal. |
Beta Was this translation helpful? Give feedback.
-
Right,
Ah I see, yes that is annoying but I see how that limits what you can do here. |
Beta Was this translation helpful? Give feedback.
-
Is there anyway you can confirm this works? I have slightly gone down the rabbit hole looking for why I am having an issue in my model and discovered two things seperately. ASE's "get_forces()" function will convert np.nan to 0 (which is an ASE bug) which means nothing will work Looking at nequip.train._loss() it looks like "ignore_nan" defaults to False, which makes me think this won't work by default. Can you somehow confirm that setting forces to np.nan will infact not include it in the loss function? |
Beta Was this translation helpful? Give feedback.
-
For future reference, there now exists a BETA interface for using this that includes an example here: https://github.com/mir-group/nequip/tree/masks/examples/mask_labels on the |
Beta Was this translation helpful? Give feedback.
-
I am curious about how constrained atoms are handled in NEQUIP. For example, I have atoms which are fully constrained in XYZ that should not be included in the model. Are these currently trained into the model and/or is there a way to filter them out?
Beta Was this translation helpful? Give feedback.
All reactions