Skip to content

Commit

Permalink
monte carlo return 업데이트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dnddnjs committed Sep 28, 2019
1 parent f28a86c commit 118887d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 1-grid-world/3-monte-carlo/mc_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def update(self):
state = str(reward[0])
if state not in visit_state:
visit_state.append(state)
G_t = self.discount_factor * (reward[1] + G_t)
G_t = reward[1] + self.discount_factor * G_t
value = self.value_table[state]
self.value_table[state] = (value +
self.learning_rate * (G_t - value))
Expand Down Expand Up @@ -106,7 +106,6 @@ def possible_next_state(self, state):

# 에피소드가 완료됐을 때, 큐 함수 업데이트
if done:
print("episode : ", episode)
agent.update()
agent.samples.clear()
break

1 comment on commit 118887d

@dnddnjs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#22

Please sign in to comment.