There are hundreds of things that can be off :). Since you’re not showing any code, just a few comments:
-
Why are
<SOS>and<EOS>are the some token index. It might not matter in your concrete setting, but generally they serve different purposes. -
Most of the time
<PAD>is represented by0. While it does not matter in principle, approaches usingpack_padded_sequenceassume that0means padding by default. In this case, you need to make it explicit that1means padding -
I assume you use the LSTM to generate sentences. In this case, bidirectionally doesn’t really makes sense.
-
Do you have any
view()orreshape()calls that might mangle your data?