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

❓ [QUESTION] About the data class AtomicData #383

Closed
floatingCatty opened this issue Nov 12, 2023 · 3 comments
Closed

❓ [QUESTION] About the data class AtomicData #383

floatingCatty opened this issue Nov 12, 2023 · 3 comments
Labels
question Further information is requested

Comments

@floatingCatty
Copy link

If this isn't an issue with the code or a request, please use our GitHub Discussions instead.

Hello!

I am recently reading the code of NequIP packages and found something confusing about the usage of the data class AtomicData.

I want to use a batch to sample multiple structures at a time, and then recover it back to subgraphs after the model computation. However, the model relies on the AtomicDataDict class rather than the original Data. And if I load the batched dict output from the model, and use Batch.from_dict to transcript it into a Batch class, it cannot use the get_example() method to reconstruct subgraphs.

  1. So I am curious why it is needed to use a dict type in the model rather than AtomicData or Batch type class.
  2. And if possible, is there any way I could reconstruct a dict of batch data to its subgraph data ?

Thanks a lot for your time !

@floatingCatty floatingCatty added the question Further information is requested label Nov 12, 2023
@Linux-cpp-lisp
Copy link
Collaborator

Hi @floatingCatty ,

Thanks for your interest in our code!

Good question: we use the dict type in the model for compatibility with TorchScript and compilation for deployment. I think the most straightforward way to achieve what you want is to keep around the original Batch object that you use as the input to the model, and to copy fields from the output dict of the model back into the input Batch object on which you can call get_example. (This of course assumes that you are mostly just predicting some new per-node/per-edge/per-graph quantities, and not changing the graph structure in the model, but of course if you are changing the graph structure this is a very different scenario.)

@floatingCatty
Copy link
Author

Thanks !

I will try to implement what you said. I just want to predict some edge features, so what you just suggest is applicable.

@Linux-cpp-lisp
Copy link
Collaborator

Sounds good @floatingCatty ! For that, the easiest thing may be to look at the --output and --output-fields options of nequip-evaluate as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants