Reinforcement Learning
1.What is Reinforcement Learning?
Reinforcement Learning is a type of machine learning where an agent learns to make decisions by interacting with an environment.The agent wants to learn a policy that gets it the most reward in the long run.
Think of it like training a dog to sit:
- When the dog sits correctly, we give it a treat (reward).
- When it doesn’t, it gets no treat (or maybe a “no!”).
- Over time, the dog learns what action gets the treat.
2.Core Concepts
Term | Simple Explanation |
---|---|
Agent | The learner or decision-maker (like the dog). |
Environment | The world the agent interacts with (like your living room). |
Action | What the agent chooses to do (e.g., sit, bark, jump). |
State | The current situation (e.g., you said “sit” and the dog is standing). |
Reward | The feedback from the environment (e.g., +1 for sitting). |
Policy | A strategy that tells the agent what action to take in each state. |
Episode | One full round of interaction (start to goal or failure). |
3. Example: Maze Game
Imagine a robot in a maze
- It starts at the entrance.
- It can go left, right, up, or down.
- The goal is to find the exit.
- If it bumps into a wall, it gets -1.
- If it reaches the exit, it gets +10.
Over time, the robot learns which paths work best.
Reinforcement Learning – Reinforcement Learning example with Simple Python