3
$\begingroup$

In Sutton and Barto (PDF, page 265), 2nd edition, Figure 13.1 applies REINFORCE to the "short corridor with switched actions" environment from Example 13.1. The figure looks like this:

enter image description here

My question is, why is the initial performance so poor? I believe it should be close to optimal even without any training.

My reasoning is this: If we initialize the algorithm with $\boldsymbol{\theta} = \boldsymbol{0}$, then the initial policy has

$$\pi({\tt right}|s,\boldsymbol{\theta}) = \frac{e^{\theta_1}}{e^{\theta_1} + e^{\theta_2}} = 0.5.$$

And from the figure in Example 13.1 (p. 323) --

enter image description here

-- we know that a policy that goes $\tt{right}$ with probability 0.5 in every state has an expected value that is very close to that of the optimal policy, around $-12$ or so. So shouldn't the policies produced by REINFORCE start close to optimal with essentially no training, and then just improve little to none after that?

My own experiment supports my hunch:

enter image description here

But it's possible I'm doing something wrong, both theoretically and computationally.

$\endgroup$

1 Answer 1

4
$\begingroup$

I'm actually working on this example too, implemented the REINFORCE algorithm, and got the same result as you. My only guess is that the authors chose a different initial $\theta$ value to show the convergence properties for different choices of $\alpha$. (For example maybe something like $\theta_0 = [-3; 0]$ so the initial probability of right action is ~0.05 and the initial expected cost is quite large.)

$\endgroup$
3
  • $\begingroup$ Yes, I think you are right. I tried setting the initial theta to $(-3, 0)$ and got a curve much more like Sutton and Barto's. The curves are nearly identical for the three values of $\alpha$, so that's another question mark, but I'll leave that one for now. $\endgroup$ Commented Aug 9, 2022 at 19:25
  • 3
    $\begingroup$ This is exactly right. In a toy example such as the above it is clear what a good starting point could be, but in eg a deep neural network this is not the case. $\endgroup$
    – David
    Commented Aug 9, 2022 at 19:45
  • $\begingroup$ I guess what was confusing is that the pseudocode for the algorithm suggests initializing $\theta$ to 0, which just happens to be a good starting point for this toy problem, but the plot shows something different and there's no comment about why. $\endgroup$ Commented Aug 10, 2022 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .