alrevuelta
alrevuelta

Reputation: 366

Dimensions of a convolution?

I have some questions regarding how this convolution is calculated and its output dimension. I'm familiar with simple convolutions with a nxm kernel, using strides, dilations or padding, thats not a problem, but this dimensions seems odd to me. Since the model that I'm using is pretty well known onnx-mnist, I assume it is correct.

So, my point is:

Find attached the convolution that I'm trying to do, hope is not too onnx specific.

model

enter image description here

Upvotes: 1

Views: 761

Answers (1)

mrzo
mrzo

Reputation: 2135

I do not see the code you are using but I guess 8 is the number of kernels. This means you apply 8 different kernels on your input with the size 5x5 over a batch size of 1. That is how you get 1x8x28x28 in the output, the 8 denotes the number of activation maps (one for each kernel).

The numbers of your kernel dimensions (8x1x5x5) explained:

  • 8: Number of different filters/kernels (will be number of output maps per image)
  • 1: Number of input channels. If your input image was RGB instead of grayscale, this would be 3 instead of 1.
  • 5: First spatial dimension
  • 5: Second spatial dimension

Upvotes: 2

Related Questions