openkim / kliff

KIM-based Learning-Integrated Fitting Framework for interatomic potentials.
https://kliff.readthedocs.io
GNU Lesser General Public License v2.1
34 stars 20 forks source link

How to use trained KIM model? #5

Closed ruoitrau86 closed 4 years ago

ruoitrau86 commented 4 years ago

Hi, After training we can save the trained model to a KIM model: model.write_kim_model() By default it will save as NeuralNetwork_KLIFF__MO_000000111111_000 which will use DUNN_WT__MD_000000111111_000 as its driver. I wonder how to install this driver to use the trained KIM model. An example script will be very appreciated.

mjwen commented 4 years ago

I was out of town on a vacation and sorry for the late response...

You can find the related info on Install a KLIFF-trained model at the KLIFF doc page. Specifically for the NN model, the driver name is changed to DUNN__MD_292677547454_000 when it was uploaded to the KIM repository.

You can install this driver by:

kim-api-collections-management install user DUNN__MD_292677547454_000

Then install the trained model by:

kim-api-collections-management install user NeuralNetwork_KLIFF__MO_000000111111_000

To use the updated driver, do model.write_kim_model(driver_name="DUNN__MD_292677547454_000") instead of model.write_kim_model(). (If you pull the latest code from the repo, "DUNN__MD_292677547454_000" becomes the default and you can still use model.write_kim_model()).