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

feat(config)!: Improved configuration and data structures #79

Open
wants to merge 145 commits into
base: main
Choose a base branch
from

Conversation

theissenhelen
Copy link
Collaborator

@theissenhelen theissenhelen commented Jan 16, 2025

Currently, the configurations are passed via hydra from yaml files. This PR adds structured configs (or schemas) and basic config validation via Pydantic base models.

Some advantageous are:

  • validation and feedback to the user before starting a training run
  • syntax highlighting and auto-complete
  • data transformations
  • decluttering the configs by introducing defaults in the schemas
  • better documentation of the configs
  • deprecation management
  • easier to define configs for unit testing

Main changes are:

  • schemas that mimic the current structure of the configs
  • a new command Anemoi-training config validate --name debug.yaml
  • For developers: If you make changes to the configs, these need to be represented in the structured configs/schemas.

ToDo:

  • support python versions 3.9 - 3.11
  • test special use cases such as LAM
  • autodocs
  • check for missing config entries
  • no-validate flag

📚 Documentation preview 📚: https://anemoi-training--79.org.readthedocs.build/en/79/


📚 Documentation preview 📚: https://anemoi-graphs--79.org.readthedocs.build/en/79/


📚 Documentation preview 📚: https://anemoi-models--79.org.readthedocs.build/en/79/

theissenhelen and others added 26 commits January 31, 2025 18:41
"Allow nans in the loss and apply methods ignoring nans for measuring the loss."


class HuberLossschema(BaseLossSchema):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class HuberLossschema(BaseLossSchema):
class HuberLossSchema(BaseLossSchema):

loss_weights: Any


LossSchemas = BaseLossSchema | HuberLossschema | WeightedMSELossLimitedAreaSchema | CombinedLossSchema
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LossSchemas = BaseLossSchema | HuberLossschema | WeightedMSELossLimitedAreaSchema | CombinedLossSchema
LossSchemas = BaseLossSchema | HuberLossSchema | WeightedMSELossLimitedAreaSchema | CombinedLossSchema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Affects the config files to training graphs models training
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

[FEATURE] improved configuration and data structures
6 participants