GithubHelp home page GithubHelp logo

Comments (9)

shyuep avatar shyuep commented on June 16, 2024

There is no way to convert a graph to structure. Getting a structure to graph is easy. But going backwards is non-trivial. Otherwise, "inverse design" would actually be simple.

What I would suggest you do is to link a structure to a graph and when you need to link the prediction from the graph to the structure, you use that information.

from matgl.

mwolinska avatar mwolinska commented on June 16, 2024

Hi, thank you for your quick reply!

I'm not sure if I understood you correctly, but my problem isn't coming from matching a prediction to a graph. I would like to use the gradient from the model (which is with respect to the graph) to inform a change in the structure itself. Is that possible?

from matgl.

mwolinska avatar mwolinska commented on June 16, 2024

Perhaps the title of my issue is misleading, let me elaborate on the problem briefly.
Currently the process to make the prediction is:

  1. Pass structure in
  2. Convert structure to graph
  3. Make a prediction on the graph

What I would like to do is after step 3:
4. Extract gradient from model,
5. Convert gradient from the embedding representation into the gradient on each atom position.

I think this is similar to what is done to extract the forces when computing energy, except I would like to do it when making a prediction using "MEGNet-MP-2019.4.1-BandGap-mfi".

from matgl.

shyuep avatar shyuep commented on June 16, 2024

That's the same thing. In the PES models, both energy and forces (the gradient of the energies) are explicitly handled as part of the prediction. So you do have the actual structure gradient in this case.

But for property prediction models, you are predicting the band gap. You have the gradient of the band gap wrt to the graph. While you can "move" the graph in the direction of the gradient, that is no easy way to translate the modified graph back to a structure.

Note that the gradient of band gap wrt to graph is not a force per se. It is not like the PES model where the gradient is an actual force on each atom that you can use to move the atoms using a Verlet algorithm.

from matgl.

mwolinska avatar mwolinska commented on June 16, 2024

Based on your first point, if the procedure is the same could I modify the property prediction to return the gradient with respect to the structure as well? If I cannot, is the reason that the atomic positions aren't an explicit input into the property prediction model and therefore I cannot access this?

Regarding your second point, am I correct in saying that although I do have access to the gradient of the band gap with respect to the graph, there is no easy way to convert this into a gradient as a gradient with respect to the structure (as a mathematical computation rather than a physical representation of a force)?

from matgl.

kenko911 avatar kenko911 commented on June 16, 2024

Hi @mwolinska. Thank you for your questions. @shyuep is right that we only return the gradient of bandgap with respect to graph attributes include nodes, edges and states for property models. If you really want to get the gradient of bandgap with respect to atomic positions. I would suggest you explicitly calculating the gradient of bond expansion (edge attributes) with respect to atomic position and then perform matrix multiplication with the gradient of band gap with respect to bond expansion (edge attributes).

from matgl.

mwolinska avatar mwolinska commented on June 16, 2024

Hi @kenko911, thank you for your suggestion! Do you think computing the gradient of bond expansion with respect to atomic position from your implementation would be fairly straightforward?

from matgl.

kenko911 avatar kenko911 commented on June 16, 2024

Based on the script you provided, I am confident that you can figure it out by your own ;). I will close this issue if no further question. Thanks.

from matgl.

mwolinska avatar mwolinska commented on June 16, 2024

Thank you!

from matgl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.