Introduction
In recent years, reinforcement learning (RL) has emerged as one of the most exciting branches of artificial intelligence.
At its core, reinforcement learning is a way for machines to learn by doing.
Inspired by how humans and animals learn from experience, RL involves an agent that interacts with an environment and learns to make decisions by receiving feedback in the form of rewards or penalties.
The goal is to maximize long-term reward through trial and error.
As an example, imagine teaching a dog to fetch a ball.
Each time it successfully brings the ball back, you give it a treat.
Over time, the dog learns that fetching the ball leads to rewards, which will reinforce it’s behavior for future times.
Reinforcement learning follows a similar principle, only with algorithms instead of dog brains.
RL has already powered impressive feats, from beating world champions at complex games like Go
From a mathematical point of view, an agent interacts with a system that can be defined by a transition function as
where taking the current action
Which action
By passing the current state
To evaluate the performance of the agent, we need the last piece of the puzzle: the reward function.
The reward function gives the agent a form of “feedback” whether it is performing well on a particular task or not.
Mathematically, the reward function maps a state
However, the reward function only gives a reward for a single transition, but obviously we are interested in maximizing rewards over multiple time steps, which leads to the definition of the return as
Here,
Starting at some inital state
Since the system dynamics and the policy are assumed to have some randomness in them, i.e., they define probability distributions rather than deterministic functions, we also have a probability distribution over possible trajectories
Now, the overall goal of the agent is to tweak the policy such that it maximizes the expected return, which is defined as
Given any policy
which gives us the expected return of policy
A strongly related concept is the so called action-value function (or Q-function), defined as
which gives us the expected return of policy