Repository navigation
Fix per-grid forcing and boundary normalization - #917
kalashmishra21 wants to merge 3 commits into
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
|
Nice catch, @kalashmishra21, and the test matrix is thorough. I copied the new test onto main: the 8 per-grid cases fail there and the 8 per-feature controls pass, and everything passes on this branch. The transpose plus repeat_interleave(dim=-1) leaves 1-D per-feature stats unchanged, so existing behaviour is untouched. One sibling worth flagging: state stats go through the same hook but don't get the transpose. With per-grid state stats in (state_feature, grid_index) order, on_after_batch_transfer (base.py:406) still raises the same kind of RuntimeError on this branch, while (grid_index, state_feature) order works. Adding the same transpose to da_state_stats around base.py:219 would make the hook consistent. Full per-grid state support probably goes further though, since StepPredictor indexes state_mean[feature_idx] for clamping (step_predictors/base.py:245), so a follow-up issue might fit better than growing this PR. |
|
@nikhil3495 Thanks for reviewing and testing the fix! Good point about the state statistics. i agree that it would be better to handle per-grid state normalization in a separate issue, especially since it may also affect clamping. I'll look into that separately. |
|
Hi @Sir-Sloth-The-Lazy , when you get a chance, could you have a look at this PR for review ? |
Describe your changes
Normalize forcing and boundary statistics in grid then feature order, and repeat statistics along the feature axis. This fixes incorrect broadcasting when a datastore supplies separate statistics for each grid point.
Add regression coverage for both statistics dimension orders, both forcing sources, and different window sizes.
Issue Link
Closes #916
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Author checklist after completed review
Checklist for assignee