Sección 1. Capítulo 3
single
Challenge: Q-table Update with Q-learning
Desliza para mostrar el menú
Tarea
Desliza para comenzar a programar
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]).
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 3
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla