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

GAP with SOAP for a molecule #213

Closed
vvassilevg opened this issue Jun 26, 2020 · 14 comments
Closed

GAP with SOAP for a molecule #213

vvassilevg opened this issue Jun 26, 2020 · 14 comments

Comments

@vvassilevg
Copy link

I would like to fit with GAP the PES of molecules using SOAP. As a test, I am using a glycine molecule (500 training points).
So far, I get high Mean Absolute Errors on the training set (the errors are of course even higher for the test set) for both Energies and Forces (above 0.07 eV and 0.7 ev/A, respectively).

I have tested different parameters for the gap fit command. One example is:

gap_fit at_file=train.xyz \
gap={soap cutoff=5.0 \
          covariance_type=dot_product \
          zeta=2 \
          delta=0.016 \
          atom_sigma=0.3 \
          l_max=14 \
          n_max=14 \
          n_sparse=2000 \
          sparse_method=cur_points} \
force_parameter_name=forces \
e0_method=average \
default_sigma={0.001 0.2 0.0 0.0} \
do_copy_at_file=F sparse_separate_file=F \
gp_file=gap_soap.xml

I have tried different values for l_max, n_max and cutoff.

An example of a molecule in my train.xyz files is:

10
Lattice="200.0 0.0 0.0 0.0 200.0 0.0 0.0 0.0 200.0" Properties=species:S:1:pos:R:3:forces:R:3 energy=-7735.046780 pbc="T T T"
N -5.400440 5.468773 2.837348 0.197830 0.001017 0.374624
H -6.365580 4.176578 3.913868 0.136175 0.068701 -0.293331
H -3.910505 6.045725 3.925944 -0.120680 0.003343 -0.049358
C -4.498210 4.417443 0.471706 -0.433094 1.062071 -0.682114
C -2.707543 2.205386 0.405318 0.102343 -0.550705 -0.104142
O -1.920056 1.231402 -1.521152 -0.009198 0.153232 0.169461
O -2.067417 1.333725 2.758112 -0.292697 0.513378 -0.084358
H -0.893916 -0.033471 2.454792 0.283477 -0.392345 -0.057309
H -6.148205 4.006446 -0.739463 0.074871 -0.442791 0.154181
H -3.631109 5.954848 -0.713001 0.060973 -0.415900 0.572343

Energy is in eV, forces in eV/A, and in this case, positions are in a.u., but I have also trained using A.

Is there anything missing (or wrong) when setting the gap_fit command and the soap descriptor?

I will be very grateful for any help you can provide.

Best regards,

@gabor1
Copy link
Contributor

gabor1 commented Jun 26, 2020 via email

@vvassilevg
Copy link
Author

Dear Prof. Csányi,

Thank you for your message.

I already set my gap fit input with your suggested values of (n_max, l_max) and with "add_species=T", and I also set all positions in A. However, the results I am obtaining are practically the same (only forces improve a little).

I think that my forces are not gradients. So, do you think that there is something else missing in my input?

Best regards.

@gabor1
Copy link
Contributor

gabor1 commented Jun 29, 2020 via email

@vvassilevg
Copy link
Author

The command is:

gap_fit at_file=train.xyz \
gap={soap cutoff=5.0 \
          covariance_type=dot_product \
          zeta=2 \
          delta=0.016 \
          atom_sigma=0.3 \
          add_species=T \
          n_max=8 \
          l_max=4 \
          n_sparse=4000 \
          sparse_method=cur_points} \
force_parameter_name=forces \
e0_method=average \
default_sigma={0.001 0.2 0.0 0.0} \
do_copy_at_file=F sparse_separate_file=F \
gp_file=gap_soap.xml

The plots are at the end of the message.

Do you think that (n_max, l_max) = (12,6) could make a huge improvement, or Is it possible that I would need to add the 2b or 3b potentials?

Eplot
Fplot

@gabor1
Copy link
Contributor

gabor1 commented Jun 29, 2020 via email

@mcaroba
Copy link
Contributor

mcaroba commented Jun 29, 2020 via email

@gabor1
Copy link
Contributor

gabor1 commented Jun 29, 2020

I think the delta matters because there are both energies and forces... it's best to try to stick to the heuristic. I agree that there is a rescaling of both delta and sigma that probably leaves things invariant...

n=8,l=4 is for a crude accuracy, but not this crude...

@gabor1
Copy link
Contributor

gabor1 commented Jun 29, 2020

And the fact that the forces are not around the x=y line is the really troublesome thing

@mcaroba
Copy link
Contributor

mcaroba commented Jun 29, 2020 via email

@gabor1
Copy link
Contributor

gabor1 commented Jun 29, 2020

In general you are right Miguel, but the problems here seem to me bigger.

@vvassilevg
Copy link
Author

Thank you both for your comments.

I have tested different values of delta and the best result I have got so far is with 0.25:
Energy MAE -- 0.005587 eV
Force MAE -- 0.132692 eV/A

Eplot
Fplot

Then I kept delta=0.25 and increased atoms_sigma to 0.5, the errors are practically the same, but slightly worse:
Energy MAE -- 0.006723 eV
Force MAE -- 0.143231 eV/A

Eplot
Fplot

Do you think I can improve the accuracy of forces with even higher values of delta and/or using (n_max,l_max) = (12,6)?

Best regards,

@gabor1
Copy link
Contributor

gabor1 commented Jun 30, 2020 via email

@mcaroba
Copy link
Contributor

mcaroba commented Jun 30, 2020 via email

@vvassilevg
Copy link
Author

I guess now that I know how to tune the parameters I can test the models to see how they perform and also work with other systems.

Thank you for your help with this issue.

Best regards,

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

No branches or pull requests

3 participants