feat: multi-component hydrograph loss function#136
Merged
taddyb merged 5 commits intoDeepGroundwater:masterfrom Feb 20, 2026
Merged
feat: multi-component hydrograph loss function#136taddyb merged 5 commits intoDeepGroundwater:masterfrom
taddyb merged 5 commits intoDeepGroundwater:masterfrom
Conversation
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.
Summary
hydrograph_loss) targeting peak amplitude, baseflow, timing, and overall fit — each per-gage normalized to prevent large basins from dominatingLossConfig(Pydantic) toExperimentConfigwith sensible defaults so existing configs work unchangedtrain.pyfor diagnostics during trainingChanges
src/ddr/validation/losses.py(new):hydrograph_losswith four components — overall MSE, peak regime (P98), baseflow regime (P30), and temporal gradient loss. Per-gage loss capped at 10 to prevent variance-collapse blowup.src/ddr/validation/configs.py:LossConfigwith weights, percentiles, and eps. Added aslossfield onExperimentConfigwith defaults.src/ddr/validation/__init__.py: Re-exportshydrograph_loss.scripts/train.py: Useshydrograph_lossinstead ofmse_loss; logs individual component values.benchmarks/: Minor config/import alignment.tests/validation/test_losses.py(new): Unit tests for all loss components.tests/integration/(new): End-to-end training loop integration test.Test plan
uv run pytest tests/validation/test_losses.py— unit tests for loss componentsuv run pytest tests/integration/test_training.py— integration test for training loop🤖 Generated with Claude Code