Calling AMP neural network model with OpenKIM

Hi,

I was wondering if it was possible to call a neural network model that was built in AMP from OpenKIM. I am following a recent bitbucket issue (https://bitbucket.org/andrewpeterson/amp/issues/79/parallelize-fingerprint-derivatives) wherein it was discussed that an AMP-OpenKIM interface was being developed. Is this available or would I need to implement it myself?

My primary issue is the same as what is stated in the issue I linked–calculation of fingerprint derivatives is highly parallelizable, but is still performed serially in AMP/ASE. They claim that this can be circumvented via an interface with OpenKIM. Are there any thoughts on this?

Any help is appreciated.

Thank you!

Luke Gibson
Pfaendtner Research Group
Chemical Engineering | University of Washington

Hi Luke,

Thanks for your interest. See below.

On Mon, Jun 4, 2018 at 8:26 PM, Luke Gibson [email protected] wrote:

I was wondering if it was possible to call a neural network model that was
built in AMP from OpenKIM. I am following a recent bitbucket issue (
https://bitbucket.org/andrewpeterson/amp/issues/79/
parallelize-fingerprint-derivatives) wherein it was discussed that an
AMP-OpenKIM interface was being developed. Is this available or would I
need to implement it myself?

  1. Just to clarify, OpenKIM is not any sort of simulation software per se.
    As far as AMP is concerned, you should think of OpenKIM fundamentally in
    terms of the KIM API (https://openkim.org/kim-api;
    https://github.com/openkim/kim-api). The KIM API provides a standard
    interface through which potentials and simulators can communicate relevant
    quantities such as atomic coordinates, forces, the potential energy, etc.
    A potential needs to be specially written to conform to these interface, in
    which case we refer to it as a KIM Model. A KIM Model is created such that
    it contains special routines that allow a simulator to, for example, pass
    it a set of atomic coordinates and have it return the forces and total
    potential energy.

  2. Because the above definition of a KIM Model is fairly abstract, i.e. the
    KIM API doesn’t care how the Model goes about computing energy/forces/etc,
    it is indeed possible to create a neural network-based KIM Model. In fact,
    one of our developers, Mingjian Wen, is working on just that.

  3. There was a request for an AMP-KIM interface some time ago. At that
    juncture, our KIM-python interface (called “openkim-python”) was
    autogenerated using SWIG and had a few problems that were causing hiccups
    such as segfaults. Thankfully, one of our developers, Mingjian Wen,
    rebuilt the KIM-python interface from scratch, as well as the ASE
    “calculator” for KIM: see the kimpy https://github.com/mjwen/kimpy and
    kimcalculator https://github.com/mjwen/kimcalculator repos on github.
    That being said, there is currently no existing AMP-KIM interface as of
    this moment. If you’re interested in doing this, Mingjian and I can
    provide guidance.

My primary issue is the same as what is stated in the issue I
linked–calculation of fingerprint derivatives is highly parallelizable,
but is still performed serially in AMP/ASE. They claim that this can be
circumvented via an interface with OpenKIM. Are there any thoughts on this?

If I understand correctly, you don’t necessarily care about the specific
values of the fingerprint derivatives (which I’m interpreting to be the
derivative of the energy with respect to the atomic environment descriptor
associated with a given atom) but rather only the total atomic forces. Is
that right?

Cheers,
Dan

Hi,

Thanks Dan and Luke for bringing up this discussion. There currently exists no Amp-KIM interface, and that is our plan to work on it now.

Dan, could you give us some instructions where I/we should start from to write a neural-network KIM model. Is Mingjian also working on a similar thing? We may want to merge efforts.

In order to make it as fast as possible, I was wondering if it is possible to have no python involved at all?

Thanks,
Alireza

Hi,

Tracing back this thread – https://bitbucket.org/andrewpeterson/amp/issues/79/parallelize-fingerprint-derivatives, I guess what you guys want is to 1) train NN potentials with AMP, 2) then convert the trained model to a KIM model, 3) and finally do large simulations directly calling this KIM model form LAMMPS or other simulation codes. Right?

If yes, then I already have a KIM model for ANN potentials that is written in C++, which you may want to use. This model now only supports the Behler symmetry functions as descriptors, and we can extend it to include more types of descriptors.

If not, can you tell me what you want to do with KIM?

Best,
Mingjian

Hi Mingjian,

You are right! Thanks for sharing the link; looking forward to trying that!

Regards,
Alireza

Hi Mingjian,

That is exactly right! Thank you for the link, I’ll try it out and get back to you if I have troubles. Just so it’s clear to me, the ANN KIM driver that you linked takes the trained AMP models as the input files? Or do we need to manually specify the ANN parameters inside the KIM driver that you linked?

Thank you,
Luke Gibson

Hi Luke,

The ANN model driver has its own input format, so it does not read AMP model directly. The format is not well-documented yet. I am out of town for a conference, and will begin to work on this when getting back to Minneapolis. So please give me a day or so and I’ll get back to you with detailed information.

Best,
Mingjian

Hi,

I add some documentation to the ANN model driver (https://github.com/mjwen/Artificial_Neural_Network__MD_000000111111_000). For the input format, please take a look at the README. Also, here is an ANN model for carbon (https://github.com/mjwen/Artificial_Neural_Network_C__MO_000000111111_000) that uses the model driver. You can refer to ANN.params here for an example input file.

Let me know if you have questions.

Thanks,
Mingjian

Thanks Mingjian! Is there any plan to merge this code to the KIM project upstream? And if yes, when this will happen? Or, we should somehow install it on local installation of OpenKIM?

Thanks again and regards,
Alireza

Hi Alireza,

This is ongoing work I am doing, and I’m still in the process of adding new stuff to the driver and optimizing it for speed. It is not anticipated to be submitted to the OpenKIM repository very soon. So I guess you need to use it with a local installation of the KIM API.

Best,
Mingjian