mir-group/flare_pp

FLARE_Tutorial_2021.ipynb produces incorrect potential energies

Closed this issue · 3 comments

Hi MIR team,

I was trying to run FLARE_Tutorial_2021.ipynb in colab (https://colab.research.google.com/drive/18_pTcWM19AUiksaRyCgg9BCpVyw744xv). The aspirin example runs smoothly, indicating that the installation of flare_pp is fine.
fig01

The Al example example, however, produces an incorrect potential energy curve although the temperature curve is good.
fig02

Do you have any suggestions?

Best,
Eric

The output of test_otf.run() is as follows

/usr/local/lib/python3.7/dist-packages/ase/io/extxyz.py:303: UserWarning: Skipping unhashable information adsorbate_info
'{0}'.format(key))
Precomputing KnK for hyps optimization
Done precomputing. Time: 0.0034034252166748047
Hyperparameters:
[2.0e+00 9.7e-02 5.0e-02 6.0e-04]
Likelihood gradient:
[-3.70118607e+00 0.00000000e+00 -4.65226400e+03 0.00000000e+00]
Likelihood:
507.64399120059767

Hyperparameters:
[ 1.99920443e+00 9.70000000e-02 -9.49999684e-01 6.00000000e-04]
Likelihood gradient:
[ 6.34674994 0. 294.90930057 0. ]
Likelihood:
-265.5908856426073

Hyperparameters:
[ 1.99979561e+00 9.70000000e-02 -2.06912782e-01 6.00000000e-04]
Likelihood gradient:
[1.11347928e+00 0.00000000e+00 1.27994395e+03 0.00000000e+00]
Likelihood:
151.22101744005056

Hyperparameters:
[ 1.99995271e+00 9.70000000e-02 -9.44565431e-03 6.00000000e-04]
Likelihood gradient:
[ 4.2125249 0. 244.53980128 0. ]
Likelihood:
780.3038128903622

Hyperparameters:
[ 2.00000141e+00 9.70000000e-02 -6.47705624e-03 6.00000000e-04]
Likelihood gradient:
[ 1.45795924e+01 0.00000000e+00 -3.47710594e+04 0.00000000e+00]
Likelihood:
743.1828488459068

Hyperparameters:
[ 1.99995374e+00 9.70000000e-02 -9.38239733e-03 6.00000000e-04]
Likelihood gradient:
[ 4.33104119 0. -55.22303239 0. ]
Likelihood:
780.3098644361403

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403540e-03 6.00000000e-04]
Likelihood gradient:
[4.31238784 0. 1.27964709 0. ]
Likelihood:
780.3101727506503

Hyperparameters:
[ 1.99995537e+00 9.70000000e-02 -9.39382734e-03 6.00000000e-04]
Likelihood gradient:
[4.31761004 0. 1.0165541 0. ]
Likelihood:
780.3101660407056

Hyperparameters:
[ 1.99995454e+00 9.70000000e-02 -9.39402122e-03 6.00000000e-04]
Likelihood gradient:
[4.3103268 0. 1.27027891 0. ]
Likelihood:
780.3101724742858

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403409e-03 6.00000000e-04]
Likelihood gradient:
[4.3180535 0. 0.91302183 0. ]
Likelihood:
780.3101725680785

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403537e-03 6.00000000e-04]
Likelihood gradient:
[4.30461414 0. 1.87590886 0. ]
Likelihood:
780.3101736194021

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403537e-03 6.00000000e-04]
Likelihood gradient:
[4.30962056 0. 0.95950237 0. ]
Likelihood:
780.3101729329906

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403537e-03 6.00000000e-04]
Likelihood gradient:
[4.31000367 0. 1.03232979 0. ]
Likelihood:
780.3101727639694

Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403537e-03 6.00000000e-04]
Likelihood gradient:
[4.31051909 0. 1.59868165 0. ]
Likelihood:
780.3101735763009

Precomputing KnK for hyps optimization
Done precomputing. Time: 0.01186990737915039
Hyperparameters:
[ 1.99995448e+00 9.70000000e-02 -9.39403537e-03 6.00000000e-04]
Likelihood gradient:
[ 12.48799445 0. -1710.43981304 0. ]
Likelihood:
1679.021783954544

Hyperparameters:
[ 2.00725532e+00 9.70000000e-02 -1.00936738e+00 6.00000000e-04]
Likelihood gradient:
[ 5.407869 0. 563.3832408 0. ]
Likelihood:
-557.1375466746391

Hyperparameters:
[ 2.00066878e+00 9.70000000e-02 -1.07229350e-01 6.00000000e-04]
Likelihood gradient:
[-3.44192440e+00 0.00000000e+00 4.96793293e+03 0.00000000e+00]
Likelihood:
686.1362494999759

Hyperparameters:
[ 1.99997620e+00 9.70000000e-02 -1.23695363e-02 6.00000000e-04]
Likelihood gradient:
[4.79527246e+00 0.00000000e+00 1.60591521e+04 0.00000000e+00]
Likelihood:
1651.3921042322436

Hyperparameters:
[ 1.99995573e+00 9.70000000e-02 -9.56535442e-03 6.00000000e-04]
Likelihood gradient:
[ 11.77653005 0. 172.39427354 0. ]
Likelihood:
1679.1509752202005

Hyperparameters:
[ 1.99995669e+00 9.70000000e-02 -9.54967573e-03 6.00000000e-04]
Likelihood gradient:
[11.85817338 0. 9.30494455 0. ]
Likelihood:
1679.152404069011

Hyperparameters:
[ 1.99995789e+00 9.70000000e-02 -9.54871056e-03 6.00000000e-04]
Likelihood gradient:
[11.8466115 0. -2.89073442 0. ]
Likelihood:
1679.152406529191

Hi @eric-yu-zhu

This is one small revision you can make, that is to add 'force_only': False to the otf_params dict. Then everything should work. We recently made the change that we set force_only to True by default, therefore, in the tutorial the energy labels from DFT are not used for training and the energy prediction of the model is awful. We will update this tutorial soon.

Also, we recently merged flare_pp to flare, and you can check the latest code and tutorials here: https://github.com/mir-group/flare/tree/development

You can check the flare pre-release 1.1.2 for the best compatibility of dependencies.

Hi Yu, this is to confirm that the problem is fixed by adding "force_only" parameter. Everything works nicely now. Thanks a lot!

Eric