Hello.
I am trying to train a basic autoencoder(seq2seq) using LSTMs.
I’m using the MSELoss for loss calculation. The issue is that I am getting NaN values when I set reduction to mean or none. However, when reduction is set to sum, I’m getting expected large values.
I’m fairly new to pytorch, so could someone please explain this ? Is this an expected action or a bug ?
Please note:
→ reduction=none/mean gives proper loss values for a small dummy dataset. However, my real dataset(quite large-librispeech) gives NaN values.
–>I have normalized my dataset.
→ The data is padded with zeros, but I have used pack_padded_sequence () before feeding into the encoder.
I would like to understand more about this. Thank you.