SeriesMachine Learning18 / 20

Reinforcement Learning

Module 18 of CS 7641 - Machine Learning @ Georgia Tech. Lesson 2 of Reinforcement Learning Series.

What Else?#

Reinforcement Learning (RL) implies reward maximization in the context of an agent-environment dynamic. In the previous module, we set the foundation for discussing RL algorithms by defining the following concepts:

We ended the last module by discussing model-based methods for solving MDPs. However, in practice, we typically don’t know the true values for MDP components such as the state transition matrix or reward function.

Practical reinforcement learning algorithms learn from data, where data is composed of instances of the form <s,a,r,s><s, a, r, s'>. Although the input differs, the objective is still the same - we are interested in computing the optimal policy for our reinforcement learning problem represented via an MDP.

mdp

RL Algorithms#

State-Action Value Function#

Before discussing alternative approaches to solving MDPs, we introduce a new kind of value function. The State-Action Value Function (also called the Q-function) assigns value to the combination of state and action. It is a direct extension of the Bellman Equation.

Q(s,a)=R(s)+γsT(s,a,s)maxaQ(s,a)Q(s, a) = R(s) + \gamma \sum_{s'} T(s, a, s') \max_{a'} Q(s', a')

Given an estimate for Q(s,a)Q(s, a), we can define state utility as maxaQ(s,a)\max_a Q(s, a) and policy as argmaxaQ(s,a)\arg \max_a Q(s, a).

Q-Learning#

Q-Learning uses instances of transitions <s,a,r,s><s, a, r, s'> to directly estimate the Q-function. The update rule is at the core of Q-Learning.

Q^(s,a)αr+γmaxaQ^(s,a)\hat{Q}(s, a) \leftarrow^{\alpha} r + \gamma \max_{a'} \hat{Q}(s', a')

Alpha represents the learning rate, which controls how quickly we update our estimate of QQ.

Qt+1(1α)Qt+α(r+γmaxaQt(s,a))Q_{t+1} \leftarrow (1 - \alpha) Q_t + \alpha \left(r + \gamma \max_{a'} Q_t(s', a')\right)

To be more accurate, Q-Learning is actually a class of RL algorithms which compute the optimal policy by estimating the Q-function. Variants of Q-Learning center on the following components.

Action Selection#

Given a Q-Learning algorithm, we might propose selecting actions by utilizing our current estimate of the Q-function. This is known as greedy selection.

π(s)=argmaxaQ^(s,a)\pi(s) = \arg \max_a \hat{Q}(s, a)

However, this strategy can lead us to become stuck in local minima, where we only explore a subset of the actions that the Q-function currently thinks is “good” (relative to other actions).

In the context of reinforcement learning, Exploration vs. Exploitation refers to the tradeoff between random action selection (exploration) and utilization of the current Q-function for action selection (exploitation). More specifically, epsilon-greedy exploration selects actions in a stochastic manner.

Pr(a)={aUniformϵargmaxaQ^(s,a)1ϵ\Pr(a) = \begin{cases} a \sim \text{Uniform} & \epsilon \\ \arg \max_a \hat{Q}(s, a) & 1 - \epsilon \end{cases}


(all images obtained from Georgia Tech ML course materials)

License

CC BY-NC-SA 4.0 This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Related Posts