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

🌟 [FEATURE] Custom properties #414

Open
ThePauliPrinciple opened this issue Mar 22, 2024 · 1 comment
Open

🌟 [FEATURE] Custom properties #414

ThePauliPrinciple opened this issue Mar 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ThePauliPrinciple
Copy link

Is your feature request related to a problem? Please describe.
Custom properties are supported. However, currently I encounter two issues:

  • The calculator class does not expose the custom properties.
  • For second order tensor predictions, if you use the current method for custom properties, you end up with an Irrep. for scalars and first orders, the irreps and cartesian tensors are the same (except maybe for some scalar multiplication which is irrelevant when fitting), but for higher order tensors the shape doesn't match.

Describe the solution you'd like

  • Some option added to the calculator class to acces the out dict of the model (e.g. self.out = out or a helper function out_transformer = lambda out, results: ... similar to how the input can be transformed.
  • Maybe a model builder can be added that transforms a tensor from irreps to explicit cartesian?

Describe alternatives you've considered

  • Reimplement the calculator class, but it requires copy pasting the entire calculate method since the output of the model is not accessible outside of it.
  • Implement the builder myself (which I've done, but maybe it's useful to make it available/make it more generic)
@ThePauliPrinciple ThePauliPrinciple added the enhancement New feature or request label Mar 22, 2024
@Linux-cpp-lisp
Copy link
Collaborator

Hi @ThePauliPrinciple ,

Regarding "The calculator class does not expose the custom properties.", unless you are specifically running e.g. ASE MD, the easiest thing to do is just to skip the ASE interface and call the model directly. (i.e. manually convert to AtomicDataDict like calculate and just call the model directly.)

Maybe a model builder can be added that transforms a tensor from irreps to explicit cartesian?

This is a good point. The simplest option of course would be to preprocess your labels into irreps and postprocess your outputs at inference time into Cartesian tensors, but doing this as a module may be easier, depending on the application. At present, nequip also only supports irreps (and not cartesian tensors) in equivariance testing and other model tooling (except for stress/virial tensors) which may also argue in favor of the first solution, unless and until direct support for Cartesian tensors is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants