This code is revised from @jnhwkim's Multimodal Compact Bilinear Pooling for Torch7. The main changes include:
- adapt the code with image inputs(4D tensor).
- get rid of spectral-lib dependency.
- the new package name is tcbp(Torch Compact Bilinear Pooling) to avoid confusion.
- new tests.
The compact bilinear pooling layer is proposed by Yang Gao etc. in the paper Compact Bilinear Pooling. This method reduces the spatial complexity of Bilinear Pooling so that it's feasible for real world training and provides a possible direction to interpret the huge success in fine grained recognition using Bilibear Pooling. We refer you to caffe implementation page for further information.
git clone https://github.com/guopei/CompactBiPooling cbp
cd cbp
luarocks make rocks/tcbp-1.0-1.rockspec
th test.lua
Read test.lua for usage.
If the following error occurs:
ld -lcufft not found
This is because the ld
cannot find the cufft
library even if you have already set the LD_LIBRARY_PATH
.
Because LD_LIBRARY_PATH
is only used at excution time not compilation time.
The solution is just adding a soft link of libcufft.so
to your system library path:
sudo ln -s /user/local/cuda/lib64/libcufft.so /user/lib
Change the location of libcufft.so
according to where its' located in your machine.
- Added code to be compatible with both lua51 and lua52.