deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.41k stars 486 forks source link

[Feature Request] logarithm loss function for high energetic density systems #2090

Open trollchu opened 1 year ago

trollchu commented 1 year ago

Summary

add an option to choose logarithm loss function for deep potential training

Detailed Description

Dear developers,

We are working on the development of metal fuel (boron) potentials using the deepmdkit and dpgen. During the dpgen process, the model performance worsens after some iterations. By checking the structures produced by "model_devi", we found there are some atoms with very short distances (~0.6 A for B-O bond). The below figure shows the DFT calculation for these structures, where the largest atomic force is > 300 eV/A! But the force deviation predict by the four deep potentials is within the range of 0.1-0.3 ( when model_devi_f_avg_relative==true). Therefore, these extremely high-energy structures are added to our training dataset and the model performance worsens. We have manually deleted these extremely high-energy structures from our training dataset, and we found the model to become better. We think these structures might have very large errors in the current linear loss function, and result in the model worsening. Could you please add some options to add a logarithm function to the loss function? We believe such a function would help the potential development for high-energy systems in combustion and explosion fields. image

Further Information, Files, and Links

No response

wanghan-iapcm commented 1 year ago

You may use pair-wise repulsive potential (provided as a tabulated potential) to push close atoms way. please refer to the doc for more detail

trollchu commented 1 year ago

Thank you, we will try the repulsive potential. I think that method only changes the distribution of structures, which aviod sampling extremely high-energy structures. But it cannot help the model training for a dataset with a wide energy range. Maybe a logarithm loss function can resove that problem. I would appreciate if the DP devepler could add that feature.

You may use pair-wise repulsive potential (provided as a tabulated potential) to push close atoms way. please refer to the doc for more detail

wanghan-iapcm commented 1 year ago

The structures were generated by the exploration of DP-GEN, which uses DPMD to sample configurations. The repulsive potential I mentioned will help pushing close atoms ways, so the extremely high-energy structures will not be generated as training data.

One more thing to notice: the accuracy of the dft calculation of structures with close atoms worsens due to the core overlap of pseudopotetentials.