Why explicitly call net.init_hidden() in RNN and LSTM?


(Naman) #1

I have recently started to work with Deep Learning and Pytorch, So please excuse me for asking silly things.
As I understand we use net.init_hidden() to initialize the weight Matrices in RNN/LSTM before training, but weight Matrices are also used in Linear and Conv Layers, So why do we explicitly call it only when using RNN or related nets, and not when we use Linear and Conv layers, Or is it that we can do the same with the other layers too. ?


#2

init_hidden initialize the hidden state of the RNN, not the weight matrix. :wink: