Extract weights from LSTM / GRU cells

(David Rau) #1

How can I access and extract weights from all cells in a LSTM / GRU layer?

(Hugh Perkins) #2

In general, you can always do list(r.parameters()), to get all the parameters of any model r.

(Anant Gupta) #3

A better alternative would be list(r.named_parameters()). This would give you a dict kind of structure

1 Like