Artificial Intelligence · Unit 9
Evolutionary and Reinforcement Learning
Exam-focused notes for Evolutionary and Reinforcement Learning (Artificial Intelligence, BIT252): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.
Evolutionary and Reinforcement Learning in short
Some learning methods copy nature or experience instead of fitting a formula. This chapter covers genetic algorithms, reinforcement learning with rewards, and learning by analogy.
What this unit covers
- Genetic algorithm operators
- Genetic algorithm learning process
- Reinforcement learning
- Rewards and punishment in learning
- Learning by analogy
Genetic algorithm learning process
Genetic algorithm operators
0 · 5 marks
Describe the different operators used in genetic algorithm. [5]
Learning by analogy
2079 · 5 marks
Describe the concept of learning by analogy with an example. [5]
Rewards and punishment in learning
2080.2 · 5 marks
What is the role of rewards and punishment in reinforcement learning? Describe with an example. [5]
Show solved answerHide answer
Role of Rewards and Punishment in Reinforcement Learning
What is Reinforcement Learning?
Reinforcement Learning (RL) is a type of machine learning where an agent learns to make decisions by interacting with an environment. The agent learns through trial and error, guided by feedback in the form of rewards and punishments.
Role of Rewards
A reward is a positive numerical signal given to the agent when it performs a desirable action. It tells the agent: "This was a good move, do more of this."
Role of rewards:
- Encourages the agent to repeat beneficial actions
- Guides the agent toward the goal state
- Increases the probability of selecting the same action in similar future states
- Helps the agent learn an optimal policy (best strategy)
Role of Punishment (Negative Reward / Penalty)
A punishment is a negative numerical signal given when the agent performs an undesirable action. It tells the agent: "This was a bad move, avoid this."
Role of punishment:
- Discourages the agent from repeating harmful or incorrect actions
- Helps the agent avoid dangerous or unproductive states
- Speeds up learning by narrowing down the action space
Core Objective
The agent's goal is to maximize the cumulative reward (total reward over time), formally expressed as:
$$G_t = r_{t+1} + \gamma r_{t+2} + \gamma^2 r_{t+3} + \cdots$$
Where:
- $G_t$ = total cumulative reward from time step $t$
- $r$ = reward at each step
- $\gamma$ = discount factor (0 to 1), which reduces the weight of future rewards
Example: Training a Robot to Navigate a Maze
Consider a robot agent placed in a maze that must find the exit.
| Situation | Action | Feedback |
|---|---|---|
| Robot moves toward the exit | Correct step | +10 reward |
| Robot hits a wall | Wrong move | -5 punishment |
| Robot falls into a pit | Dangerous move | -20 punishment |
| Robot reaches the exit | Goal achieved | +100 reward |
Learning Process:
- Initially, the robot moves randomly.
- When it hits a wall, it receives -5, so it learns to avoid walls.
- When it moves toward the exit, it receives +10, so it repeats that direction.
- Over many episodes, the robot learns the optimal path to the exit by maximizing total reward.
Summary
| Concept | Signal | Effect on Agent |
|---|---|---|
| Reward | Positive (+) | Reinforces good behavior |
| Punishment | Negative (-) | Discourages bad behavior |
| Goal | Maximize cumulative reward | Learns optimal policy |
In essence, rewards and punishments together act as a feedback mechanism that shapes the agent's behavior over time, enabling it to learn complex tasks without explicit programming.
Make Unit 9 stick
Practice BIT252 with flashcards & quizzes