Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions reinforcement_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def __call__(self, percept):
actions_in_state = self.actions_in_state

if s in terminals:
Q[s, None] = r1
Q[s, None] = r
if s is not None:
Nsa[s, a] += 1
Q[s, a] += alpha(Nsa[s, a]) * (r + gamma * max(Q[s1, a1]
Expand Down Expand Up @@ -330,7 +330,7 @@ def __call__(self, percept):
a1 = max(actions_in_state(s1), key=lambda a2: self.f(Q[s1, a2], Nsa[s1, a2]))

if s in terminals:
Q[s, None] = r1
Q[s, None] = r
if s is not None:
Nsa[s, a] += 1
# on-policy update: bootstrap on the actually-chosen next action a1
Expand Down
Loading