8000 Update cartpole_a2c.py · rlcode/reinforcement-learning@8bb4ba8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bb4ba8

Browse files
authored
Update cartpole_a2c.py
1 parent 454f77c commit 8bb4ba8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

2-cartpole/4-actor-critic/cartpole_a2c.py

Lines changed: 1 addition & 2 deletions
< 5CCB /tr>
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ def train_model(self, state, action, reward, next_state, done):
7474
advantages[0][action] = reward - value
7575
target[0][0] = reward
7676
else:
77-
advantages[0][action] = reward + self.discount_factor * (
78-
next_value - value)
77+
advantages[0][action] = reward + self.discount_factor * (next_value) - value
7978
target[0][0] = reward + self.discount_factor * next_value
8079

8180
self.actor.fit(state, advantages, epochs=1, verbose=0)

0 commit comments

Comments
 (0)
0