Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise 4.6: Changes in Policy Iteration algorithm for epsilon-soft policies #97

Open
MoeenTB opened this issue Nov 3, 2023 · 0 comments

Comments

@MoeenTB
Copy link

MoeenTB commented Nov 3, 2023

I think the answer can be a bit more detailed. What I have in mind is not very qualitative but goes something like this:

Modified Step 3:
The second line of the inner loop:
$\pi(s)$ should become stochastic and satisfy: $\pi(s) = \dfrac{\epsilon}{|A(s)|}$ for all $a \in A(s)$ other than $\text{arg}\max\limits_{a} \sum_{s', r} p(s', r|s, a) [r + \gamma V(s')]$ and $\pi(s) =1 - \dfrac{(|A(s)| - 1) \epsilon}{|A(s)|}$.

Modified Step 2:
The second line of the inner loop:
$V(s) \gets \sum_{a} \pi(a|s) \sum_{s', r} p(s', r|s, a) [r + \gamma V(s')]$

Modified Step 1:
$\pi(s)$ should satisfy the $\epsilon-soft$ criterion when being initialized as well. One way to make sure of that is to set $\pi(a|s)$ for all but one $a \in A(s)$ to $\dfrac{\epsilon}{|A(s)|}$ and $\pi(a|s)$ for the remaining action to $1 - \dfrac{(|A(s)| - 1) \epsilon}{|A(s)|}$.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant