Reinforcement Learning
In RL, the Transition Probability Function and Reward Function are unknown. i.e. agent does not know how often a transition can go wrong
So the agent,
Types of RL

- Active Learning - No policies given for the world
- Passive Learning - Evaluating a given policy for the world
Episode Based Evaluation
Agent explore the world and get to the goal or terminate. That is a single episode. Then the observed world will change the current predictions.
Model Based Learning
The agent keep running episodes for some number of times. Then it finds and for the whole world.
- - Count how many times actually got from to when performed
- - Record the rewards as it explore the world.
After this, its a MDP Problem and solved for the optimal policy
Whole Flow:
Caveats of Model based learning
Size of the Transition Probabilities Space is HUGE. (ex. 1,000 states and 4 actions give 4 million parameters.) Reason - A tabular transition model needs one probability per
Strengths of Model based learning
Since it has a model, it captures structure. So every sample we take helps massively.
Model Free Learning
In these algorithms, the model is gone. And it does not try to find the or for each transition. It learns what to do, or how good things are, directly from experience.
Model-based: experience → model → values → policy Model-free: experience → values or policy
Analogy: A model-free agent is like a cyclist who has learned to balance by feel, with no physics equations. A model-based agent is like an engineer who writes down the dynamics first and then works out how to ride.
Passive Learning
Evaluating a given, already-defined policy
What happens,
- You are given a fixed policy
- The agent follows and watches what happens. It makes no choices.
- Goal: learn the value of the policy,
Direct Evaluation
- run the policy for several episodes
- for every state visit, compute (Total discounted reward from there to the end) Same as Markov Decision Process#Rewards & Discounting
- is the Average of the discounted rewards observed from the state.
Temporal Difference learning
Temporal Difference means, learn a little from every new experience you get. The agent samples new episodes and the New value that's obtained from that will contribute a little to the already established value we have for a state.
Agent experience,
The value for that state from agent's current guess is updated with a little step towards the new Value from that sample.
- - Learning Rate () This determines how much the sample will contribute to the value.
| World | Evaluation |
|---|---|
![]() | Observe Sample = −2 + 1 × V(C) = −2 + 0 = −2 δ = sample − V(B) = −2 − 0 = −2 V(B) ← 0 + 0.5 × (−2) = −1 |
This works fine since we already know the policy. But finding does not allow us to get the policies if its unknown. For that, are required

Active Learning
What happens,
- The optimal policy is unknown.
- Agent must decide which action to take and find out what happens
- Goal: learn the optimal policy

In this case, since we do not have information about the values, we use the old values assigned for each state, action pairs to get the updated values.
Q Learning
Agent experience
How agent choose an action to continue?
In Q learning, Agent choose the best possible action for the state from the previous Q values, because of this, agent might choose actions even though due to the stochastic behavior, failures might hurt more even the action is the best.
In this world, the Q learning would pick the blue path even though there is a huge chance that agent might fell into the cliff.
To avoid this, the agent must explore alternatives even though they might not be the "best" actions "for the moment".
SARSA
This algorithm allows agent to take other actions than the best one to explore the world more.

In SARSA, The in is chosen,
- With probability , exploit by taking the action with the highest
- With probability , explore by taking a random action.
Action with highest Q value is known as the "Greedy Action"

- N - No. of available actions.
