Skip to content

Conversation

Jubeku
Copy link
Contributor

@Jubeku Jubeku commented Sep 29, 2025

Description

This PR enables to provide a weighting function to distinctly weight forecast steps in the loss calculations.
The implemented function is a gamma function with a scale factor. The name of the weighting function and the scale factor are provided in the default_config.yaml.
In principle other functions could be implemented within the same structure.

Issue Number

Closes #904

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

@Jubeku Jubeku self-assigned this Sep 29, 2025
@Jubeku Jubeku added enhancement New feature or request model Related to model training or definition (not generic infra) labels Sep 29, 2025
- "mse"
- 1.0

timestep_weight:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this backwards compatible?

return (max_value - min_value) * np.cos(latitudes_radian) + min_value


def gamma_decay(forecast_steps, gamma):
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we can put this in a util file?

@Jubeku Jubeku changed the base branch from mk/develop/fe_experiments to develop September 29, 2025 15:14
@Jubeku
Copy link
Contributor Author

Jubeku commented Oct 8, 2025

@Jubeku Jubeku requested a review from sophie-xhonneux October 8, 2025 09:02
@Jubeku
Copy link
Contributor Author

Jubeku commented Oct 8, 2025

Forecast fine-tuning experiments: As expected, gamma decay helps to improve scores in the early steps as they are weighted more during rollout training (compare red 8-step training to blue baseline).

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request model Related to model training or definition (not generic infra)

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Gamma decay loss weights across forecast steps

3 participants