Search code examples
luadeep-learningtorch

Where is the main code of convolutional nets?


Although I want to modify code of convolutional nets, I could not find the main routine of the convolutional nets. The main routine is convolution and pooling.

SpatialConvolution.lua had the code below.

 96 function SpatialConvolution:updateOutput(input)
 97    backCompatibility(self)
 98    viewWeight(self)
 99    input = makeContiguous(self, input)
100    local out = input.nn.SpatialConvolutionMM_updateOutput(self, input) -- where?
101    unviewWeight(self)
102    return out
103 end

So I thought the routine was in SpatialConvolutionMM. However, SpatialConvolutionMM.lua had the code below.

 65 function SpatialConvolutionMM:updateOutput(input)
 66    -- backward compatibility
 67    if self.padding then
 68       self.padW = self.padding
 69       self.padH = self.padding
 70       self.padding = nil
 71    end
 72    input = makeContiguous(self, input)
 73    return input.nn.SpatialConvolutionMM_updateOutput(self, input) -- where??
 74 end

So does anyone know where is SpatialConvolutionMM_updateOutput?


Solution

  • There's an open issue on GitHub for the same. One of the solution mentions upgrading nn and cunn:

    luarocks install nn
    luarocks install cunn
    

    Also, take a look at this reply.