1
$\begingroup$

I have a very simple question about CNNs, which I unfortunately couldn't find an explanation for.

Imagine we have a CNN, that has four filters (eg right, left, top, bottom edges) each of those outputs a 2x2 feature map for simplicity. Each of them gets flattened, so we are left with 4 4x1 feature maps. Does the fully connected input layer have 4 input nodes, where we feed the 4x1 maps, or does it have 16 input nodes, each 4 corresponding to the feature map of a certain filter?

$\endgroup$

1 Answer 1

1
$\begingroup$

The second proposal is the correct one. You just flatten all features maps to a single vector.

In the example in PyTorch you can see that clearly: https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#define-a-convolutional-neural-network

Here all the features are flattened so you have a matrix with dimensions batchsize x total number of features.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.