Skip to content

Commit a7b14b8

Browse files
MorvanZhouMorvan Zhou
authored andcommitted
fix action shape
1 parent ce4a828 commit a7b14b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tutorial-contents/405_DQN_Reinforcement_learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def choose_action(self, x):
5858
# input only one sample
5959
if np.random.uniform() < EPSILON: # greedy
6060
actions_value = self.eval_net.forward(x)
61-
action = torch.max(actions_value, 1)[1].data.numpy()[0] # return the argmax
61+
action = torch.max(actions_value, 1)[1].data.numpy()[0, 0] # return the argmax
6262
else: # random
6363
action = np.random.randint(0, N_ACTIONS)
6464
return action

0 commit comments

Comments
 (0)