You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$$
V \left( S _ { t } \right) \leftarrow V \left( S _ { t } \right) + \alpha \left[ R _ { t + 1} + \gamma V \left( S _ { t + 1} \right) - V \left( S _ { t } \right) \right]
$$
$$
\begin{aligned}
v _ { \pi } ( s ) & \doteq \mathbb { E } _ { \pi } \left[ G _ { t } | S _ { t } = s \right] \\
& = \mathbb { E } _ { \pi } \left[ R _ { t + 1} + \gamma G _ { t + 1} | S _ { t } = s \right] \\
& = \mathbb { E } _ { \pi } \left[ R _ { t + 1} + \gamma v _ { \pi } \left( S _ { t + 1} \right) | S _ { t } = s \right] \end{aligned}
$$
$$
Q \left( S _ { t } ,A _ { t } \right) \leftarrow Q \left( S _ { t } ,A _ { t } \right) + \alpha \left[ R _ { t + 1} + \gamma Q \left( S _ { t + 1} ,A _ { t + 1} \right) - Q \left( S _ { t } ,A _ { t } \right) \right]
$$
这个公式使用若干个$\left( S _ { t } ,A _ { t } ,R _ { t + 1} ,S _ { t + 1} ,A _ { t + 1} \right)$状态对,故而称作Sarsa算法。一个完整的控制流程如下:
$$
Q \left( S _ { t } ,A _ { t } \right) \leftrightarrow Q \left( S _ { t } ,A _ { t } \right) + \alpha \left[ R _ { t + 1} + \gamma \mathbb { E } \left[ Q \left( S _ { t + 1} ,A _ { t + 1} \right) | S _ { t + 1} \right] - Q \left( S _ { t } ,A _ { t } \right) \right]\\
\leftarrow Q \left( S _ { t } ,A _ { t } \right) + \alpha \left[ R _ { t + 1} + \gamma \sum \pi \left( a | S _ { t + 1} \right) Q \left( S _ { t + 1} ,a \right) - Q \left( S _ { t } ,A _ { t } \right) \right]
$$