szagoruyko / imagine-nn

IMAGINE torch neural network routines
Other
109 stars 35 forks source link

ROIPooling #11

Closed szagoruyko closed 8 years ago

szagoruyko commented 9 years ago

TODO:

fmassa commented 9 years ago

I'll push my version of ROIPooling, which is in lua using SpatialAdaptiveMaxPooling, and seems to perform almost as fast as this cuda implementation.

szagoruyko commented 9 years ago

I think maybe we should do

if self._type == 'torch.CudaTensor' then
  C.inn_ROIPooling_updateOutput(cutorch.getState(),
  self.output:cdata(), self.indices:cdata(), data:cdata(), rois:cdata(),
  self.W, self.H, self.spatial_scale)
else
  -- your lua implementation
end
szagoruyko commented 9 years ago

but before you should push non-contiguous adaptive max pooling to nn and cunn

fmassa commented 9 years ago

if it's going to be used only for CPU, then the non contiguous version already in nn. But I'll push the cuda version as well

0wu commented 9 years ago

I am interested in using the cpu/gpu ROIPooling module. Is the implementation here (as well as the nnf one) ready to be distributed ? Anything I could help contribute ?

fmassa commented 9 years ago

@0wu The implementation here is being tested by me and @szagoruyko for some time now and it seems stable. The one in nnf seems to work exactly as this one, but I still need to finish some tests to be 100% sure. It would be great if you could write some gradient-tests for ROIPooling for nnf cpu version, and also a test comparing inn implementation to it. This is what is missing to make them ready to be merged.

0wu commented 9 years ago

The gradient tests and comparison to nnf.ROIPooling is submitted in #13

0wu commented 9 years ago

inn.ROIPooling seems to assume the images of one batch are of the same size. Would it be possible to relax this further at least for the cpu version ? An alternative is to have users pad small images to the size of the largest image.

szagoruyko commented 8 years ago

closed by https://github.com/szagoruyko/imagine-nn/pull/17

szagoruyko commented 8 years ago

thanks @fmassa and @0wu