This is the great solution i got from Soumith :
for a local convolution layer in ccn2, weight is a 2D tensor of shape:outputSIze*nInputPlane*filterSize in the 1st dimensionnOutputPlane in the 2nd dimension.
I pulled this information directly from the code.
Now for yo to get each kernel separately, you have to do this:
weight = weight:transpose(1,2):clone()
weight = weight:view(nOutputPlane, outputSize, nInputPlane, filterSize)
weight = weight:transpose(1,2):clone()
weight = weight:view(outputHeight, outputWidth, nOutputPlane*nInputPlane, filterHeight, filterWidth)
Now, to get the set of filters at location 3,4 for example, you do:
filters = weight[3][4]
This will be a tensor of the form {nFilters, height, width} and can be directly seen as a series of images. You can visualize this with image.display or gfx.image