0
$\begingroup$

I have already a few projects in deep learning under my belt. However, there is one fundamental thing that has come to my mind recently while trying to implement my own architecture.

Looking at the PyTorch tutorial for example, one sees that for the fully connected layer, one has to compute manually some dimensions to make the layers consistent between each other.

Even if I were to transform the FC layer to an equivalent convolutional one, I would still need to compute the size of the input to know which filter size I have to use.

So I am wondering, in practice, how do you deal with those computations ? Do you do this by hand? I am surprised that PyTorch does not have a built-in attributes/functions to directly provide one layer's output dimensions once an input is flowing through. Or am I missing something ?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.