Hello, everyone!
I want to ask “How do we mask softmax output from neural network?”
In some case, like reinforcement learning, we just can do some constraint actions and we will sample the action from softmax/log_softmax output. So, we need to mask the condition which it won’t happen.
When I use mask tensor like [0. 0. 0. 1. 0. 1.] (FloatTensor) to multiply softmax output, it will sometimes comes to nan/-inf. Futhermore, it will cause runtime error: cuda runtime error (59) : device-side assert.
How do we mask the softmax/log_softmax output appropriately?
Thank you.