Policy Improvement
ã¡ãã¥ãŒã衚瀺ããã«ã¯ã¹ã¯ã€ãããŠãã ãã
Policy improvement is a process of improving the policy based on current value function estimates.
Like with policy evaluation, policy improvement can work with both state value function and action value function. But for DP methods, state value function will be used.
Now that you can estimate state value function for any policy, a natural next step is to explore whether there are any policies better than the current one. One way of doing this, is to consider taking a different action a in a state s, and to follow the current policy afterwards. If this sounds familiar, it's because this is similar to how we define the action value function:
qÏâ(s,a)=sâ²,rââp(sâ²,râ£s,a)(r+γvÏâ(sâ²))If this new value is greater than the original state value vÏâ(s), it indicates that taking action a in state s and then continuing with policy Ï leads to better outcomes than strictly following policy Ï. Since states are independent, it's optimal to always select action a whenever state s is encountered. Therefore, we can construct an improved policy Ïâ², identical to Ï except that it selects action a in state s, which would be superior to the original policy Ï.
Policy Improvement Theorem
The reasoning described above can be generalized as the policy improvement theorem:
â¹âqÏâ(s,Ïâ²(s))â¥vÏâ(s)vÏâ²â(s)â¥vÏâ(s)ââsâSâsâSâThe proof of this theorem is relatively simple, and can be achieved by a repeated substitution:
vÏâ(s)ââ€qÏâ(s,Ïâ²(s))=EÏâ²â[Rt+1â+γvÏâ(St+1â)â£Stâ=s]â€EÏâ²â[Rt+1â+γqÏâ(St+1â,Ïâ²(St+1â))â£Stâ=s]=EÏâ²â[Rt+1â+γEÏâ²â[Rt+2â+γvÏâ(St+2â)]â£Stâ=s]=EÏâ²â[Rt+1â+γRt+2â+γ2vÏâ(St+2â)â£Stâ=s]...â€EÏâ²â[Rt+1â+γRt+2â+γ2Rt+3â+...â£Stâ=s]=vÏâ²â(s)âImprovement Strategy
While updating actions for certain states can lead to improvements, it's more effective to update actions for all states simultaneously. Specifically, for each state s, select the action a that maximizes the action value qÏâ(s,a):
Ïâ²(s)ââaargmaxâqÏâ(s,a)âaargmaxâsâ²,rââp(sâ²,râ£s,a)(r+γvÏâ(sâ²))âwhere argmax (short for argument of the maximum) is an operator that returns the value of the variable that maximizes a given function.
The resulting greedy policy, denoted by Ïâ², satisfies the conditions of the policy improvement theorem by construction, guaranteeing that Ïâ² is at least as good as the original policy Ï, and typically better.
If Ïâ² is as good as, but not better than Ï, then both Ïâ² and Ï are optimal policies, as their value functions are equal, and satisfy Bellman optimality equation:
vÏâ(s)=amaxâsâ²,rââp(sâ²,râ£s,a)(r+γvÏâ(sâ²))ãã£ãŒãããã¯ããããšãããããŸãïŒ
AIã«è³ªåãã
AIã«è³ªåãã
äœã§ã質åããããææ¡ããã質åã®1ã€ã詊ããŠãã£ãããå§ããŠãã ãã