Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Feature/tendency scaler #186

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Feature/tendency scaler #186

wants to merge 4 commits into from

Conversation

pinnstorm
Copy link
Member

Draft PR for tendency-scaler following PressureLevelScaler example

@pinnstorm pinnstorm self-assigned this Dec 5, 2024
split = key.split("_")
if len(split) > 1 and split[-1].isdigit():
# Apply pressure level scaling
if split[0] in config.training.variable_loss_scaling.pl:
variable_loss_scaling[idx] = config.training.variable_loss_scaling.pl[
variable_loss_scaling[idx] *= config.training.variable_loss_scaling.pl[
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if with the tendency scaling, the variable scaling factor set by the user should be ignored?

self.statistics_tendencies["stdev"][prog_idx] if self.statistics_tendencies else 1
)
scaling = tendency_scaler.scaler(variable_stdev, variable_tendency_stdev)
LOGGER.debug("Parameter %(key)s is being scaled by statistic_tendencies by %(scaling).2f")
Copy link
Member

Choose a reason for hiding this comment

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

This didn't work for me but the following did:

LOGGER.debug(f"Parameter {key} is being scaled by statistic_tendencies by {scaling:.2f}")

@mc4117
Copy link
Member

mc4117 commented Dec 6, 2024

I have tested this with the ensemble branch

This is with the tendencies and without the pressure level scalings
image

and this is with the tendencies and the pressure level scalings (also down-weighted w)

image

@@ -117,3 +117,7 @@ pressure_level_scaler:
_target_: anemoi.training.data.scaling.ReluPressureLevelScaler
minimum: 0.2
slope: 0.001

Copy link
Member

Choose a reason for hiding this comment

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

I would have a comment explaining briefly what tendency scaler does.

@mc4117 mc4117 mentioned this pull request Dec 19, 2024
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants