Skip to content

Commit 346e64b

Browse files
authored
Merge pull request p-christ#55 from strombom/patch-1
max_probability_action bugfix for batchsize > 1
2 parents d5847e8 + c2da672 commit 346e64b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agents/actor_critic_agents/SAC_Discrete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def produce_action_and_action_info(self, state):
5252
"""Given the state, produces an action, the probability of the action, the log probability of the action, and
5353
the argmax action"""
5454
action_probabilities = self.actor_local(state)
55-
max_probability_action = torch.argmax(action_probabilities, dim=1)
55+
max_probability_action = torch.argmax(action_probabilities, dim=-1)
5656
action_distribution = create_actor_distribution(self.action_types, action_probabilities, self.action_size)
5757
action = action_distribution.sample().cpu()
5858
# Have to deal with situation of 0.0 probabilities because we can't do log 0

0 commit comments

Comments
 (0)