The differentiability of translation in affine transformation? #2771
Replies: 1 comment
-
f you want learn the translation, be aware that's already part of the affine matrix transform ((tx, ty) == m[..., :, 2]). So i'm not sure why are you adding the extra translation step here. About the affine operator, the transform matrix is in pixel space (you can see that internally implements the In order to use properly kornia functions you might have to normalize/denormalize the transform matrix depending what you want to do (we have functionality for that too). In any case, can you share a colab or something minimal to reproduce ? That could be also good material for tutorial. We can fix things in the api to make it more accessible for others. I saw also in the past similar things |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to see if kornia's
affine()
is differentiable. The main code I wrote is as the following:This is invoked by a training loop, the code is used to do a registration,
The code in the comment is the affine function provided by torchvision.
The result I got is quite surprising, e.g.
Also, it seems no matter how I try to change the optimization goal or even add a translation code, the left up corner always will not move. Thus I am wondering if translation is not differentiable in this case. Thank you so much for your guys help.
Beta Was this translation helpful? Give feedback.
All reactions