jnhwkim / cbp

Multimodal Compact Bilinear Pooling for Torch7
Other
68 stars 23 forks source link

how to modify the code if dimemsion of input is 3? #13

Closed cloud-waiting-for-wind closed 7 years ago

cloud-waiting-for-wind commented 7 years ago

I find this code can only handle the input whose dimension is 2. in the paper of Berkeley, they use cbp layer to do attention, the input become 2048_14_14 or 2048_196, if the batchsize is 20, the input of cbp layer will become 20_2048_196 and the input dimension will become 3.

I find assert(false, '# of dimensions > 2') in CompactBilinearPooling.lua. how to modify the code if the dimemsion of input is 3 or more ?

jnhwkim commented 7 years ago

We can detour that issue using nn.Reshape. Please refer to this model. And refer to a comment from one of authors.