Difference between nn.Linear and nn.Conv1d


(Xuyang Bai) #1

I think Linear and Conv1d these two layers performs similarly when doing pointwise convolution, so what is the difference between these two layers and how can I choose which one to use ?


#2

when num_channel=1, kernel=1, strider=1, padding=1 then they are the same


(Ashish Gupta) #3

As far i know …when you have to preserve the spatial information like in the semantic segmentation…use convolution. And when you need not to do anything related to spatial information like in basic classification(mnist,cat dog classifier) go with Linear layers.