fix pred_std scaling - #523
Conversation
99fb1ec to
f67dd44
Compare
|
Hi @sadamov @joeloskarsson , I noticed this issue regarding |
|
thanks @Debadri-das. Did you see that in the linked issue @joeloskarsson asked for training curves and offered a even better implementation option? It would be great to see these curves before we merge any fix. |
|
Absolutely @sadamov , I'll check that linked issue and generate the training curves with @joeloskarsson 's suggested approach. Let me run those and share the results before we merge. |
f67dd44 to
db586bd
Compare
Re-applies @Debadri-das's PR mllam#523 onto current main. The target file `base_graph_model.py` was moved to `models/step_predictors/graph/base.py` by mllam#208; the surrounding code is otherwise unchanged. Expanded the NOTE-comment to explain WHY the scaling is needed (initial pred_std otherwise sits at softplus(0) = ln(2), independent of variable scale, which blows up NLL/CRPS in early training for any variable whose physical step-diff std is much larger). Co-Authored-By: Debadri Das <Debadri-das@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Re-applies @Debadri-das's PR mllam#523 onto current main. The target file `base_graph_model.py` was moved to `models/step_predictors/graph/base.py` by mllam#208; the surrounding code is otherwise unchanged. Expanded the NOTE-comment to explain WHY the scaling is needed (initial pred_std otherwise sits at softplus(0) = ln(2), independent of variable scale, which blows up NLL/CRPS in early training for any variable whose physical step-diff std is much larger). Co-Authored-By: Debadri Das <Debadri-das@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
db586bd to
b302892
Compare
|
@Debadri-das pinging this - rebased onto current main (file moved to Still up for the training curves from April, or want me to close? |
Re-applies @Ayushhgit's PR mllam#253 onto current main, scoped down to the clear-cut feature-weights fix and rebased onto the post-mllam#208 layout: - The original PR also added `+ 1e-6` to `softplus(pred_std_raw)` to guard against float32 underflow at very negative `pred_std_raw`. That overlapped with mllam#523's `* self.diff_std` scaling on the same line and is largely redundant once pred_std starts on the empirical scale, so dropped here to avoid coupling the two PRs. - Target file `models/ar_model.py` is gone since mllam#208; fix is applied at `models/module.py:120` next to the existing `per_var_std` registration. - Use `torch.finfo(torch.float32).eps` instead of a hard-coded `1e-8` for the sqrt epsilon, matching the eps choice used a few lines below for `state_std` / `forcing_std`. - Slimmed tests/test_numerical_stability.py to the 3 feature-weights assertions (finite output, eps does not perturb non-zero weights, warning fires with the zero index). Dropped the softplus / wmae / wmse integration tests since the softplus piece is no longer in scope. Refs mllam#526. Co-Authored-By: Ayush <Ayushhgit@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing this in favour of #649, which consolidates the probabilistic metrics + ensemble plumbing track for v0.8.0. The |
Describe your changes
Immediately after softplus, scale the predictor standard deviation (
pred_std) using the one-step difference statistics (self.diff_std).Instead of beginning around ~0.69, this first scales
pred_stdto the empirical step differences. This keeps measurements like NLL and CRPS from experiencing logarithmic loss explosions in the early stages of training. This offers a better initialization scale, as was discussed with @joeloskarsson. We consider this to be the main initialization step; training curve evaluation is necessary to determine whether the suggested/ softplus(0.)scaling multiplier will be needed as a follow-up.None.
Issue Link
linked to #347
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review