feat: Add Stochastic Decomposition Layer and Fix Dependencies #188
+161
−1
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
This PR implements the Stochastic Decomposition Layer (SDL) as a new standalone module, addressing issue #185.
The SDL enables the injection of controllable noise into feature maps, facilitating uncertainty quantification by separating deterministic signals from stochastic perturbations. This implementation is based on Section 2.2 of the paper "Controllable Probabilistic Forecasting with Stochastic Decomposition Layers".
Important
Dependency Fix: This PR also includes a critical fix for the
nnja_aidependency. The main package__init__.pyimportsnnja_aiviaSensorDataset, but the existing code referenced the wrong package name (nnja). This was causing the entire package to crash on import, blocking the execution of the new tests.Key Changes:
StochasticDecompositionLayeringraph_weather/models/layers/stochastic_decomposition.py.graph_weather/data/nnja_ai.pyto fix an import error (from nnja import ...->from nnja_ai import ...).graph_weather/models/__init__.py.Fixes #185
How Has This Been Tested?
I have added a comprehensive test suite in
tests/test_stochastic_decomposition.pyto verify the module's correctness and stability.Test Coverage:
alpha,style_net) and inputs.To reproduce, run:
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: