Temporal Difference (TD) learning combines ideas from MC and DP: update value estimates using a mix of immediate reward and bootstrapped next-state value. TD(0) is the one-step version.
Instead of waiting for episode completion (MC) or needing the full model (DP), TD updates immediately: V(s) = V(s) + α[r + γV(s') - V(s)]. The term [r + γV(s') - V(s)] is the TD error.
Implement td_prediction(episodes, gamma, alpha) which:
Update values incrementally using TD(0) rule.
No results yet
Run your code to check it against the examples, or submit to run every test.