Inrtroduction
Inrtroduction
In Reinforcement Learning (RL) we consider the problem of learning how to act, through experience and without an explicit teacher. A reinforcement learning agent must interact with its world and from that learn how to maximize some cumulative reward over time.
For example, in game playing AlphaGo used Reinforcement Learning methods to reach superhuman performance in Go, and Reinforcement Learning concepts are also often borrowed in the training of Generative Adversarial Networks.
Based on the methods and way of learning, machine learning is divided into mainly four types, which are:
- Supervised Machine Learning: is based on supervision. It means in the supervised learning technique, we train the machines using the "labelled" dataset, and based on the training, the machine predicts the output.
- Unsupervised Machine Learning: here there is no need for supervision. It means, in unsupervised machine learning, the machine is trained using the unlabeled dataset, and the machine predicts the output without any supervision.
- Semi-Supervised Machine Learning: is a type of Machine Learning algorithm that lies between Supervised and Unsupervised machine learning. It represents the intermediate ground between Supervised (With Labelled training data) and Unsupervised learning (with no labelled training data) algorithms and uses the combination of labelled and unlabeled datasets during the training period.
- Reinforcement Learning: Reinforcement learning works on a feedback-based process, in which an AI agent (A software component) automatically explore its surrounding by hitting & trail, taking action, learning from experiences, and improving its performance. Agent gets rewarded for each good action and get punished for each bad action; hence the goal of reinforcement learning agent is to maximize the rewards. There is no labelled data like supervised learning, and agents learn from their experiences only.

Advantages in RL:
- It helps in solving complex real-world problems which are difficult to be solved by general techniques.
- The learning model of RL is similar to the learning of human beings; hence most accurate results can be found.
- Helps in achieving long term results.
Disadvantages to RL:
- RL algorithms are not preferred for simple problems because of their complex nature.
- RL algorithms require huge data and computations.
- Too much reinforcement learning can lead to an overload of states which can weaken the results.

Challenges with Reinforcement Learning
Prerequisite: Deterministic vs Stochastic Models
Deterministic models produce the same exact results for a particular set of inputs. That is the outcome is determined.
Stochastic models are the opposite, this model presents data and predicts outcomes that account for certain levels of unpredictability or randomness. That is the outcome for each input is a probability distribution over multiple possible results.
Exploration-vs-Exploitation Tradeoff
- Exploration: It is more of a long-term benefit concept where it allows the agent to improve its knowledge about each action which could lead to long term benefit. Agents primarily focus on improving their knowledge about each action instead of getting more rewards so that they can get long-term benefits. So, in this technique, agents work on gathering more information to make the best overall decision.
- Exploitation: It is defined as a greedy approach in which agents try to get more rewards by using estimated value but not the actual value. So, in this technique, agents make the best decision based on current information. Here the agent’s current estimated value is exploited and chooses the greedy approach to get the most reward. However, the agent is being greedy with the estimated value and not the actual value, so chances are it might not get the most reward.
The key challenge that arises in designing RL systems, is in balancing the trade-off between exploration and exploitation, where the agent needs to decide between potentially finding new, better strategies at the risk of a receiving a lower reward, or, if it should exploit what it already knows. In a stochastic environment, actions will have to be sampled sufficiently well to obtain an expected reward estimate. An Agent that pursues exploration or exploitation exclusively is bound to be less than expedient. It becomes worse than pure chance (i.e. a randomized agent).
Components of RL
Reinforcement Learning deals with the problem of making a sequence of good decisions

| Symbol(s) | Definition/Use |
|---|---|
| Model / Enviornment | |
| set of possible states in the world | |
| sequence of states observed, indexed by time | |
| set of possible actions in the world | |
| sequence of actions taken, indexed by time | |
| sequence of observations noted, indexed by time | |
| Reward Function | |
| sequence of rewards (response) received, indexed by time | |
| transition dynamics (probability of next state given previous state of acttions) | |
| Estimation | |
| History at time "t" (History is the set of previously visited states and actions) | |
| Agent State Function | |
| Policy | |
| Discount Factor | |
| Value Function |
Markov Property
In reinforcement learning, we often assume the Markov Property:
that is, the next state in a model (with the Markov Propery) ONLY depends upon the current state and action .
Systems like deterministic or probability-driven games, and computer-controlled simulations can be designed to have easily observable states that have this property. Games with this trait are often called "games of perfect information", although you may have unknown information, provided it is revealed in a purely stochastic manner.
In practice, real world interactions contain far too much detail for any observation to be a true state with the Markov property.
Reward Function
A reward function is used to predict rewards. We consider the reward to be received on the transition between states, i.e. . It is given as the estimated reward given the current action, current state and next state:
we often represent this as:
It will also often be the case that is degenerate, that is, has a fixed value, given .
Components of a RL Agent
The agent state (current state of the agent) is a function of the history, . A reinforcement learning agent typically has an explicit representation of one or more of the following three things:
-
Policy [ ]: it is a mapping from the agent state to an action .
-
In Deterministic Distribution: the policy takes a specific step w.r.t to a state. Hence, (state at time " " on action " " under the policy " ", returns an action belonging to the set of all actions " " in our enviornment).
-
In Stochastic Distribution: the agent picks an action (set of all actions), with the Transition Probability [ stochastic distribution over actions ] (i.e. the probability of TAKING action " " GIVEN the state " " at time " ")
-
-
Value Function [ ]: is an expected sum of discounted rewards. Where is the Disount Factor and has a value between [0, 1], it is used to weigh immediate rewards (when ) versus delayed rewards (when ). Where " " denotes that the expectation is taken over states encountered by following the policy " ". The Value Func is given as:
-
Model [ ]: A model consists of the above Transition Dynamics and Reward Function . If the agent has a model, we would call it a model-based agent, and if it doesn't incorporate a model, we would call it a model-free agent. An illustration of a RL model:

Observations vs State
If our model is perfectly observable (i.e. All important information is recorded perfectly), we call the model as fully observable. In this case the Observations is equivalent to the States .
We call the case where partially observable, and it is common in partially observable settings for RL algorithms to maintain a probability distribution over the true world state to define , which is known as a belief state.
Types of RL Agents
| Agent Type | Poliy | Value Function | Model |
|---|---|---|---|
| Value Based | ✅ (Implicit) | ✅ | ⬜ |
| Policy Based | ✅ | ❌ | ⬜ |
| Actor Critic | ✅ | ✅ | ⬜ |
| Model Based | ⬜ | ⬜ | ✅ |
| Model Free | ⬜ | ⬜ | ❌ |
✅ , ⬜ , ❌

Continious domains VS Discrete States
Consider a simple game contoller:

There are 2 possible types of inputs:
- Discrete: These are simple mechanisms with a 0/1 input signal. For Example: Buttons
- Continuous: These types of inuts refer to sliding values, that may be bound between a range of [-1, 1]. For Example: Joysticks, Levers & Robotics and Control.