In model-based reinforcement learning, we tried real hard to get T and R. What if we just estimated Q(s,a) directly? model-free reinforcement learning tends to be quite slow, compared to model-based reinforcement learning methods.
review: estimating mean of a random variable we got m points x^{(1 \dots m)} \in X , what is the mean of X?
every time you get a new measurement x^{(m)}. sometimes we don’t scale it by \frac{1}{m}, you can scale it with constant \alpha which actually causes exponential decay of past samples (as it keeps getting scaled by \alpha).
Q-Learning Let us review the action-value function:
this is a model-free method, substituting in the definition of the value function:
Note! The second half is know in the shape of an expectation ("probability times the value"). Recall also that R(s,a) is the expected reward r when taking s,a. Let:
So we can say that:
Finally, then, we can perform random variable mean estimation scheme given above; recall:
hence, we update our new mean with:
SARSA SARSA is Q-Learning where you hope the model converges. You HAVE to perform some Exploration and Exploitation to try out other actions, and then you just update your function accordingly:
this works in theory because over time, good Exploration and Exploitation assumes that:
Eligibility Traces Eligibility Traces is a change to SARSA which uses the number of visits as an additional constraint that allows updates to propagate each reward backwards given the list of states which caused that reward to be distributed. Meaning, let \lambda be some decay parameter, we have:
and, we can write:
where by the visit counts are discounted such that:
See also Sarsa (Lambda). Generalized Q-Learning with Gradient action-value Consider Value Function Approximation. We were trying to fit a set of \theta at that time to find U_{\theta} that matches U^{*}. We now want to compute some Q_{\theta} in the same flavour:
We can measure the difference between these two values like so:
We want to write this expected value distributed over s,a of the optimal policy because we want to calculate more samples over those states that the optimal policy ends up at most. To optimize Q_{\theta}, then, you betcha know what’s happenin:
by a healthy dose of the chain rule. Now, to minimize this loss, we go in the direction opposite the gradient. The negatives then cancel out to give us:
where \alpha \in (0,1). Similar to the SARSA assumption, good Exploration and Exploitation assumes that:
so we can drop our expectation with:
Now, we can make one more assumption, the assumption from Q-Learning:
that taking the best actions with the Q you have will slowly approximate optimal Q.
you will note! this is actually just Q-Learning multiplying with a gradient. Policy Gradient see also Policy Gradient