Evaluate a policy from two sampled returns
Keep each reward, discount and value next to its number. · 173 words
Policy evaluation asks how well a fixed policy, or rule for choosing actions, performs. To evaluate it by sampling, run complete episodes and record each episode's return. A return is the sum of rewards, optionally discounted so distant rewards count less: G_t = r_(t+1) + gamma r_(t+2) + ..., where gamma is between 0 and 1. A sampled return is the value observed in one episode, not a guaranteed result. Averaging sampled returns gives a simple Monte Carlo estimate of the policy's expected return.
Suppose a shopping robot follows one policy in two episodes. Rewards of 3, 2, and 1 give an undiscounted return of 6. Rewards of 4, 3, and 2 give 9. The two-sample estimate is (6 + 9) / 2 = 7.5 points per episode. The true value may differ because two episodes may be unrepresentative. If gamma = 0.5, the discounted returns are 3 + 0.5(2) + 0.25(1) = 4.25 and 4 + 0.5(3) + 0.25(2) = 6.00, so the estimate becomes (4.25 + 6.00) / 2 = 5.125.
Check your recall
Using the shopping robot's two sampled undiscounted returns of 6 and 9, what is the two-sample policy-value estimate, and why might it differ from the true value?
Check your answer
The estimate is (6 + 9) / 2 = 7.5 reward per episode. It may differ from the true expected return because only two observed episodes were used, and they may not represent the policy's typical performance.
Sources and credits
Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.