Sectie 1. Hoofdstuk 3
single
Challenge: Q-table Update with Q-learning
Veeg om het menu te tonen
Taak
Veeg om te beginnen met coderen
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]).
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 3
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.