[Question] Is the objective to maximize general rewards or discounted rewards?
This may be a general question for RL algorithms. Are they trying to optimize the episode rewards without discount or the discounted reward? When I use tensorboard to visualize the results, I found that the episode reward (without discount) goes up gradually but the discounted rewards can drop a bit. Thank you!
You can optimize for either-or, depending on the situation, but you more commonly see optimizing the discounted returns (including this repository). See e.g. Spinning Up RL tutorial for more info.
@Miffyli Thank you for the reply. Yes, my understanding is that we are optimizing the discounted returns. However, when I try to run the PPO2 with discount factor 0.99, my episode reward goes to 60 in the end while my discounted reward is only 20. There're only 20 steps in the environment, meaning if I discount all the rewards, the least I should get 60*0.99^20 ~ 49 for the discounted reward. Could you explain the inconsistency I get from the results? Thank you.
If you start tracing back from PPO2 code where tensorboard logs these, you will end up to part where returns are calculated via GAE computations. I do not know if this should end up to standard returns, but it could causing this discrepancy (would be fun to dig deeper, but currently taking weekend off from bigger headaches).
as @miffyli wrote, you can optimize for one or the other (setting gamma to one). In practice, most algorithms use the discounted return. SAC have a slightly different objective: it tries to maximize the entropy in addition to the discounted return.