Section 1. Chapitre 3
single
Challenge: Q-table Update with Q-learning
Glissez pour afficher le menu
Tâche
Glissez pour commencer à coder
Challenge: Given a Q-table and a sequence of actions, update the Q-values using the Q-learning rule.
- For each transition in
transitions, update the Q-value inq_tablefor the givenstateandactionusing the Q-learning update formula. - Each transition is a tuple: (
state,action,reward,next_state). - Use the learning rate
alphaand discount factorgammafor the update. - The Q-learning update formula is:
Q[state, action] = Q[state, action] + alpha * (reward + gamma * max(Q[next_state]) - Q[state, action]).
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 3
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion