The return from a step is the total discounted reward collected from there on. It is the quantity policy-gradient methods weight their updates by, in the simplest (REINFORCE) form.
Implement discounted_returns(rewards, gamma), computing the discounted return from each step.
Start at zero after the final step and add r_t + gamma times the return from the next step.
No results yet
Run your code to check it against the examples, or submit to run every test.