Conversation
|
@meiertgrootes please also see the top comment when reviewing. |
| overlap=1, | ||
| max_H=1024, | ||
| max_W=1024, | ||
| max_H=256, |
There was a problem hiding this comment.
Moving to lat,lon based encoding this would be less relevant, but how does this match to the total grid size given theglobal input data?
There was a problem hiding this comment.
Here the max_H and max_W in SpatialPositionalEncoding2D is the maximum number of patches in the height and width directions. For example, if the image is 1024×1024 pixels with a patch size of (1, 4, 4), we have 256 patches in H and W. The max_H and max_W arguments can be changed by users if needed. However, about global data, we don't usually give the large image to the model, but we subset it and embed the subsets in the batch dimensions.
There was a problem hiding this comment.
Ok, thanks. So max_H, max_W are basically the total input dimensions quantised by the patch size. That is fine, of course, and I also understand that we aren't passing the full global image in one go. My point was, that as it stands, the 2d positional encodings are pre-calculated on the basis of these sizes, i.e. the sine and cosine values derive from the max_H and max_W values. Should one change input dimensions/resolution this may be a challenge to generalisation. Other approaches also have their own difficulties, this is just sth. to remain aware of.
meiertgrootes
left a comment
There was a problem hiding this comment.
The batch handling look a lot cleaner and the carry over og lat long information will elp with global spatial embedding. This may make the chocie of max size (see comment) less critical.
closes #17
This PR adds :
This PR fixes main things as:
This PR also improves:
Results:
Note: As can be seen in the final plots, there is not spatial artifacts. I also run the notebook on residuals in this branch. The results also are without artifacts.
Note: The notebooks in this PR can be run on local systems. If the input size or data patch size are changed, the model patch size and overlap should be adjusted accordingly.