Add structure-function (variogram) loss for sharper fine-scale fields - #2665
Open
wael-mika wants to merge 2 commits into
Open
Add structure-function (variogram) loss for sharper fine-scale fields#2665wael-mika wants to merge 2 commits into
wael-mika wants to merge 2 commits into
Conversation
Grid-free structure-function loss (LossStructureFunction) matching S(r) from point-pair increments, for sharpening smooth ensemble forecasts. 'reduce' supports 'mean', 'median' (per-point sorted middle), 'members' (SF per sorted member, averaged), or an int member index. Exported in loss_modules/__init__ so LossCalculator can instantiate it by name from the config. CPU unit tests included. Imported from wm/dev/latent_upsampling (eb1e1be, 58aa6fe, b1b5a6c) without the experiment configs and latent-upsampling engine changes.
Replace the per-bin Python loop and its int(...sum()) guards with a single bucketize + scatter_add reduction, cutting GPU->CPU host syncs from ~B+1 to 1 per call (x K in members mode) and removing the redundant per-bin boolean-mask allocations. Also make the module/config docstrings general
Contributor
|
Very cool stuff! Just for future reference, variogram based scores are somewhat popular in ensemble forecasting, this is the key reference: https://doi.org/10.1175/MWR-D-14-00269.1 that probably tells us how this can be generalised to ensembles. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
LossStructureFunction, a grid-free variogram loss that matches the variance of spatial increments per distance bin, so fine-scale fields stay sharp instead of blurring to the MSE conditional mean. Composes with MSE and doubles as a validation sharpness metric. New module + unit tests only; nothing existing changes.Unit tests to be removed once the PR is reviewed and FT config to be introduced privately or in this repo if needed!
Issue Number
Closes #2663
Checklist before asking for review
./scripts/actions.sh lint./scripts/actions.sh unit-test./scripts/actions.sh integration-testlaunch-slurm.py --time 60