I have LSTM with 3 inputs and 1 output. Dataset returns ((tensor1, tensor2, tensor3), tensor_target). How to reshape my Dataset outputs to make in work with LSTM input?
batch_size = 5
n_hidden = 1
encoder_size = 64*2*2
seq_len = 3
rnn = nn.LSTM(encoder_size, encoder_size, n_hidden)
input = torch.randn(seq_len, batch_size, encoder_size) # how to reshape to this shape?
output, (hn, cn) = rnn(input)
This assumes that tensor1.shape = (batch_size, encoder_size); same of tensor2 and tensor3, of course. If the shapes are (seq_len, encoder_size) then you have to adopt the code a bit. But I cannot tell which shapes your tensors have.