Closed wiederm closed 7 months ago
Hello! So:
In what unit is the training dataset and in what unit should the self-energies be provided? Should the atomic self-energies be provided in the energy unit of the training set or is it a specific unit the training set is converted to and the self-energies should be provided in? Specifically, how should we do this for the ANI2x and the SPICE dataset?
The self energies should be provided in whatever units the training energies are given to model (so if the model receives kcal/mol, the self energies should be in kcal/mol). We do not do any unit conversions in physicsml (all conversions are up to the user). For the ANI2x and SPICE dataset, the self energies should be in whatever unit you choose to convert the energies of the dataset into and give to the model (with that said, there are certain choices of units which are better for numerical stability than others, it depends on how large the (energy - self_energy)
scale is). Does this make sense?
How do we obtain "scaling_mean" and "scaling_std" for a given training dataset?
Good question! This depends on the model architecture actually. I will add a PR to clarify this more in the docs. But for the MACE model, the
scaling_mean
: is the mean over the training dataset of (molecule_energy - molecule_self_energy) / molecule_num_atoms
.scaling_std
: is the std over the training dataset of (molecule_energy - molecule_self_energy)
.This is because the MACE model applies the scale and shift to the individual node energies before adding the self energies. So the scaling_std is the std of the difference of energy and self_energy and the scaling_mean must be normalised by the number of atoms (since the final energy is the sum of the node energies).
For the script: Everything looks good, but one thing about checkpointing: The ModelCheckpoint
will only save the checkpoints to dir specified, but the best checkpoint will not be applied to the model (the model will be saved with the weights of the last epoch). To apply the best weights to the model, use the ModelCheckpointApply
callback (which is identical to the ModelCheckpoint
callback, but applies the best model weights to the model at the end of training).
Hope this helps! Let me know if you have more questions!
For the SPICE dataset, I would also be careful with the coordinates (They are in bohrs not in angstroms).
Thank you! This addressed all open questions!
Hi everyone,
thank you for the great work on physics-ml! We (tagging here @sboresch and @AnnaPicha) have been using physicsml to train MACE models on different datasets.
We have a few questions about the training:
We have trained the MACE model with the following script. Does this look reasonable for you?
Thank you very much for your help!