A3C (Mnih et al., 2016) runs many workers in parallel, and each collects a short rollout of n steps before updating. The learning target for that rollout is an n-step return: the rewards actually seen, plus a bootstrapped value for the state at the end.
Implement n_step_return(rewards, bootstrap, gamma), returning the discounted sum of the rewards plus the discounted bootstrap value.
Start from bootstrap, and for each reward from last to first set G = r + gamma * G.
No results yet
Run your code to check it against the examples, or submit to run every test.