How to avoid padded indices during calculation of softmax using tf.nn.softmax?
You could set your padded cells to a value close to -Infinity (i.e. very small compared to your other logits), so that their contributions are just negligible.
I have a matrix where each row is padded to maxlen. If I apply softmax on the matrix, the padded indices are also considered. How to apply softmax on the matrix while considering only the non-padded indices?
Note: padded length in each row of the matrix would differ.