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

Rewrite target and dataset info classes #216

Closed
wants to merge 184 commits into from

Conversation

PicoCentauri
Copy link
Contributor

@PicoCentauri PicoCentauri commented May 29, 2024

Based on the discussion in #185 moving the creation of the DatasetInfo from the train function into a function I fall into a rabbit hole and ended up with rewrtiting the target and dataset dataclasses. The former classes TargetInfo and DatasetInfo now have new methods for copy, union and update.

Also, I introduced a new class TargetInfoDict which is a special dictionary to work (only) with TargetInfo instances. The TargetInfoDict has methods for union intersection and difference. Basically, all of these methods were already used by some architectures but were implemented always by “hand”.

One thing you will notice that I changed also the types for the gradients in TargetInfo and the atomic_types in the DatasetInfo. Both are now of type set.

I think these changes make our code cleaner and also easier for architecture developers to work with our Info objects. If we need more methods we can now add them easily.

These new classes also allow us to ship the targets and the target infos (TargetInfoDict) together when reading targets from a file with the read_targets function. Metatensor style :-)

TODO

  • change values of regression tests if we agree on the code.
  • write examples for new classes in their docstrings.

📚 Documentation preview 📚: https://metatensor-models--216.org.readthedocs.build/en/216/

frostedoyster and others added 30 commits November 20, 2023 15:51
* Rename package to `metatensor-models`

* Rename module to `metatensor.models`
* Write train output to hydra's output directory

* Added evaluation function

* Add usage example for cli interface

* update train cli

* Disable MacOS tests

* Add cli skeleton for exporter

---------

Co-authored-by: frostedoyster <[email protected]>
* Add gradient calculator
* Temporary losses
* Forces and stresses
* Support multiple model outputs in SOAP-BPNN
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.

10 participants