You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In patch_utils.py, the modules ExtractPatches and MergePatches are missing an axis swap between the reshapes, resulting in the extracted patches becoming horizontal stripes. For example, if we follow the code in ExtractPatches:
We see that the first patch extracted is not the patch containing [0, 1, 4, 5], but the horizontal stripe [0, 1, 2, 3].
To fix this problem, we should add an axis swap. For ExtractPatches, this should be:
@young-geng Thanks for pointing it out. If you would like to create a PR then please go ahead otherwise I'll correct it in a couple of days along with the next push.
Unfortunately the problem has not been completely fixed. Because we have changed our order of axes in ExtractPatches, we have to take that into account when reshaping in MergePatches. Therefore, in this line, we need to change
x = jnp.reshape(inputs, (batch, height, patch_size, width, patch_size, -1))
to
x = jnp.reshape(inputs, (batch, height, width, patch_size, patch_size, -1))
Thanks a lot for working on this and fixing the problem! This project is awesome!
In patch_utils.py, the modules ExtractPatches and MergePatches are missing an axis swap between the reshapes, resulting in the extracted patches becoming horizontal stripes. For example, if we follow the code in ExtractPatches:
We see that the first patch extracted is not the patch containing [0, 1, 4, 5], but the horizontal stripe [0, 1, 2, 3].
To fix this problem, we should add an axis swap. For ExtractPatches, this should be:
For MergePatches, this should be:
The text was updated successfully, but these errors were encountered: