The same basic question here, but 3 years old and no definitive answer:
The question is, if I'm doing policy gradient in keras, using a loss of the form:
How do I manage negative rewards?
I've had success with this form in cases where the reward is always positive, but it does not train with negative rewards. The failure mode is for it to drive itself to very confident predictions all the time, which results in very large negative losses due to induced deviation for exploration. I can get it to train by clipping rewards at zero, but this throws a lot of valuable information on the table (only carrots, no sticks).
NOTE: Originally posted here: https://stackoverflow.com/questions/61829580/how-to-manage-negative-rewards-in-policy-gradient-in-keras