IA Chap6
IA Chap6
IA Chap6
Plan du cours
1. Introduction
2. Principe de l’apprentissage par renforcement
3. Algorithme Q-Learning
4. Applications
1. Introduction
Apprentissage supervisé versus apprentissage par renforcement
Système d’apprentissage
supervisé
Système d’apprentissage
Entrée : Etat Sortie : Action
par renforcement
Objectif de l’apprentissage par renforcement :
Evaluation de la qualité de l’action.
1. Introduction
Action sur
l’environnement
Agent Environnement
Observation de l’Etat
Agent : de l’environnement Environnement :
• Robot • Magasin
• Enfant • Maison
• Voiture • Parking
• etc • etc
3. Algorithme Q-Learning
, = , + + max [ , ,
3. Algorithme Q-Learning
Algorithm parameters :
• terminal_state = 5
• learning_rate: = 0.5
0 1 2
• discount_factor: = 0.5
• epsilon: = 1.0
• n_states = 6 3 4 5
• n_actions = 4
• n_episodes = 2
, = , + + max [ , ,
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters : Un épisode définit le parcours que
• learning_rate: = 0.5 fait l’agent pour aller d’un état initial
• discount_factor: = 0.5
0 1 2 vers l’état terminal.
• episode = 1
Un step définit le pas de déplacement
• step = 1
de l’agent pour passer d’un état à un
• state = 3 3 4 5 autre.
• action =
, = , + + max [ , ,
3,2 = 3,2 + 0.5 × [3,2] + 0.5 × max 4,0 ; 4,1 ; 4,2 ; 4,3 ] 3,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 1
• state = 3 3 4 5
• action =
3,2 = 3,2 + 0.5 × [3,2] + 0.5 × max 4,0 ; 4,1 ; 4,2 ; 4,3 ] 3,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 2
• state = 3 3 4 5
• action = 0
, = , + + max [ , ,
4,0 = 4,0 + 0.5 × [4,0] + 0.5 × max 3,0 ; 3,1 ; 3,2 ; 3,3 ] 4,0 = 2.50
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 3
• state = 3 3 4 5
• action = 0
, = , + + max [ , ,
3,0 = 3,0 + 0.5 × [3,0] + 0.5 × max 3,0 ; 3,1 ; 3,2 ; 3,3 ] 3,0
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 3
• state = 3 3 4 5
• action = 0
3,0 = 3,0 + 0.5 × [3,0] + 0.5 × max 3,0 ; 3,1 ; 3,2 ; 3,3 ] 3,0
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 3
• state = 3 3 4 5
• action =
3,2 = 3,2 + 0.5 × [3,2] + 0.5 × max 4,0 ; 4,1 ; 4,2 ; 4,3 ] 3,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 1
• step = 5
• state = 4 3 4 5
• action =
4,2 = 4,2 + 0.5 × [4,2] + 0.5 × max 5,0 ; 5,1 ; 5,2 ; 5,3 ] 4,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 2
• step = 1
• state = 0 3 4 5
• action =
0,2 = 0,2 + 0.5 × [0,2] + 0.5 × max 1,0 ; 1,1 ; 1,2 ; 1,3 ] 0,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
Algorithm parameters :
• learning_rate: = 0.5
• discount_factor: = 0.5
0 1 2
• episode = 2
• step = 1
• state = 0 3 4 5
• action =
0,2 = 0,2 + 0.5 × [0,2] + 0.5 × max 1,0 ; 1,1 ; 1,2 ; 1,3 ] 0,2
, Actions , Actions
State 0 1 3 State 0 1 3
3. Algorithme Q-Learning
3. Algorithme Q-Learning
, Actions , Actions
State 0 1 3 State 0 1 3