Closed 0wu closed 8 years ago
Hi @0wu, Thank you very much for those gradient checks. It's very cool :)
Also I liked your subclassing to use the standard jacobian tests. The only small problem is that we can't evaluate the error wrt the bboxes, but I think that's ok.
We are aware of the failing SpatialSameResponseNormalization
problem https://github.com/szagoruyko/imagine-nn/issues/8 , it's due to some change in nn
or torch
from a couple of months ago (the tests were passing with an old version), but I hadn't had the time to explicitly check which commit is causing the problem.
It's great that both nnf
and inn
versions of ROIPooling
are giving the same results :) I'm curious though that the gradient checks doesn't pass all the time, inn
version is mainly an adaptation from original Fast-RCNN
implementation to torch, the kernels are the same. I'll have a better look later on today.
@0wu I'm a bit in a hurry lately, I'll review it this weekend at most.
I figure out the failing gradient test above, it was because the the added "delta" for finite difference changed the maximum element in the maxpooling function. One quick fix is to generate test input carefully such that the elements in each pool are different enough that their order is preserved even with the added "delta". @fmassa , do you want me re-submit a fixed pull-request for this ?
Also, may be I should also test for ROI out of image boundary which is allowed in certain ROIPooling implementation.
@0wu Sorry for the late reply, things were crazy here with CVPR deadline.
Indeed, there is a difference between nnf
and inn
implementations of ROIPooling
when the pooling region is outside the image. I'll eventually fix it in nnf
(but it will involve a memory copy in this case).
Regarding resubmitting the pull request with the fixes, I think you can add the new commits here, no need to create a new PR for that.
Thanks again !
v2 fixes the issue in the backprop, fixed by https://github.com/szagoruyko/imagine-nn/pull/17
my crude implementation of the Jacobian check for nnf.ROIPooling and inn.ROIPooling.
I made the following not so comfortable choices but not sure if there were any better solutions.
Some observations running test_jacobian.lua