Repository navigation
fix: seed regional decoder observation nodes with encoder features - #239
Merged
jacobbieker merged 1 commit intoJul 27, 2026
Merged
Conversation
jacobbieker
approved these changes
Jul 27, 2026
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.
Pull Request
Description
RegionalForecasterseeds its decoder observation nodes withtorch.zeros, discarding the per-observation features the encoder just computed - the same bug that #237 fixed inStretchedForecaster. Each observation's predicted change can only be read back from its assigned cell's pooled, message-passed feature, so the observation's own values reach the output only through the fixed residual. In #237 this collapsed the stretched model to the persistence baseline on a 2-sample overfit (floor 0.173 = persistence, dropping to 0.136 once fixed).This applies the identical fix here: seed the decoder's observation nodes with the encoder's per-observation features (
nodes[:num_obs]) instead of zeros, so the learnable delta can specialise per observation. No new parameters.Follow-up to #237, which flagged this pattern in
RegionalForecaster. Related to #3How Has This Been Tested?
Added
test_decoder_seeded_with_encoder_obs_featurestotests/test_regional_forecast.py- a plain pytest that hooks the decoder GNN, runs a forward pass, and asserts the observation nodes it receives are non-zero (they carry the encoder output rather than the old zeros seed). It fails on the previous code.Commands:
pytest tests/test_regional_forecast.py -q-> 14 passedruff check graph_weather/models/regional_forecast.py tests/test_regional_forecast.py-> cleanChecklist: