Those weight variables cannot be used according to the LSTM documentation. How can I initialize those weight variables?
You are trying to access an attribute of nn.LSTM
:
model = nn.LSTM(1, 1)
print(model.weight_ih_l0)
> Parameter containing:
tensor([[-0.0077],
[ 0.1228],
[-0.4166],
[-0.9885]], requires_grad=True)
while your current object seems to be an object of the LstmRNN
class, which is not a PyTorch module, but seems to be a custom class.
Depending on the class definition I assume that you might be using an nn.LSTM
module internally, e.g. via lstm_model.lstm
or any other name.