Add a decoding mask option to only include subset of grid nodes in m2g#34
Conversation
sadamov
left a comment
There was a problem hiding this comment.
Looks good! Agree that this is required. Testing for "less than" seems sufficient 👍
More general comment: I am slightly worried about the mask being generated in mllam-data-prep and then being used here and in neural-lam. We probably need some solid checks in neural-lam about the dimensions of the graph, the data-tensors and the mask.
Co-authored-by: Leif Denby <leif@denby.eu>
Co-authored-by: Leif Denby <leif@denby.eu>
|
@leifdenby if you agree with my fixes this should now be done, except for the documentation notebook. The tests fail because of the existing test notebook |
leifdenby
left a comment
There was a problem hiding this comment.
Thank you for adding the tests and in general bringing this forward! I have added a few comments.
I have also updated the notebook locally on my computer. Do you want me to push to your branch? I haven't reworked the part of the notebook that describes the changes to the graph as stored to disk, but I would like to do that too. I think with your input my comments below I will be able to do that.
|
@leifdenby I fixed and responded to all your comments now. Please commit the updated documentation notebook directly here and I can have a look. |
leifdenby
left a comment
There was a problem hiding this comment.
Thanks for making all those changes! I will update the notebook now and then we can merge this in. Maybe you want to update the changelog now while I do that @joeloskarsson? Thanks 😊
|
I decided to complete remove the part of the notebook which examines what is actually written to disk @joeloskarsson. I did this so we can get this PR merged in, and improve the documentation later. Wrt what I stored to disk, I instead I have started a notebook on the current |
|
Thanks a lot for the notebook! I just made some small tweaks in 69f7f84. I think this should be good to be merged now. Let me know if you have anything more or if I should go ahead. |
Love the tweaks ❤️
Yup, we just need a changelog entry and this will be ready to go in :) |
|
Awesome! This means that I can release |
Describe your changes
For LAM forecasting it is reasonable to not always predict values in nodes that are considered part of the boundary forcing. This is in particular a change planned for neural-lam. When we consider the graphs involved, this means that the g2m edges should only connect to a subset of the grid nodes.
This PR introduces an option
decode_maskthat allows for specifying an Iterable of booleans (e.g. a numpy-array) specifying which of the grid nodes should be included in the decoding-part of the graph (m2g). This allows in the LAM case to specify such a mask with True for the inner region nodes.This builds on #32, which should be merged first. Here is a diff for only this PR in the meantime: joeloskarsson/weather-model-graphs@general_coordinates...decoding_mask
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee