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

Adapt models to handle generic targets #386

Merged
merged 69 commits into from
Nov 25, 2024
Merged

Adapt models to handle generic targets #386

merged 69 commits into from
Nov 25, 2024

Conversation

frostedoyster
Copy link
Collaborator

@frostedoyster frostedoyster commented Nov 11, 2024

This PR defines the capabilities of each one of the current model in the documentation and performs the corresponding checks in the code. Part of #364.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

📚 Documentation preview 📚: https://metatrain--386.org.readthedocs.build/en/386/

Base automatically changed from generic-readers to main November 21, 2024 13:04
@Luthaf Luthaf requested a review from spozdn November 22, 2024 09:54
Copy link
Contributor

@DavideTisi DavideTisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only tests for saopbpnn where the functionality works, not for catching the errors in the other models, maybe add tests

if not (
target.is_scalar
and target.quantity == "energy"
and "atom" not in target.layout.block(0).samples.names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here a stupid question becouse i do not know the code. when atom is in target.layout.block(0).samples.names,
target.quantity can still be energy? if this is the case i can see a case where the error becomes:

"GAP only supports total-energy-like outputs, but a energy was provided"

which do not make much sense.
If this is the case split this error message for the case "atom" not in target.layout.block(0).samples.names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I will split the error message

Copy link
Collaborator

@spozdn spozdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently I see this:

raise ValueError(
"PET only supports total-energy-like outputs, "
f"but a {target.quantity} was provided"
)
should we instead propagate the request for generic targets to PET right away, given that PET does support 1) multidimensional targets, 2) targets per atom and per structure, and 3) both sum and mean aggregations?

@frostedoyster
Copy link
Collaborator Author

frostedoyster commented Nov 25, 2024

@spozdn The goal for this PR is to make sure that each type of target is handled by each architecture. We allowed spherical vector targets for SOAP-BPNN, but this is just to test the correctness of the whole infrastructure. Also GAP and the alchemical model could in principle fit a larger range of targets than those allowed here, as can PET, but that would be for a different PR. When it comes to PET, we're having a lot of integration issues even with the basic energy targets, so I wouldn't add more burden by adding more options until the current integration issues are solved and people want to use the extra features

Copy link
Contributor

@DavideTisi DavideTisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me it is fine, for the discussion with PET I leave to you and sergey

@frostedoyster
Copy link
Collaborator Author

Thanks! Regarding the extra features for PET, I will make sure to open an issue. Waiting for #399 to be merged to avoid adding more problems to that PR

@frostedoyster frostedoyster merged commit 09e2550 into main Nov 25, 2024
13 checks passed
@frostedoyster frostedoyster deleted the adapt-models branch November 25, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants