Skip to content

Commit 979795b

Browse files
committed
Add action number in probs
1 parent 4dac217 commit 979795b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/ml/raylib/environment.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,11 @@ def print_probs(self, model):
240240

241241
best_actions = [pair for pair in zip(action_probs[0].tolist(), self.actions, range(self.num_actions))]
242242
best_actions.sort(key=lambda pair: -pair[0])
243+
i = 0
243244
for prob, action, id in best_actions:
244245
if prob != 0:
245-
print(self.action_to_string(action), "{:0.4f} %".format(prob * 100))
246+
print(f"{i}: "+self.action_to_string(action), "{:0.4f} %".format(prob * 100))
247+
i = i + 1
246248
return best_actions[0][2]
247249

248250
def as_byte_vector(self):

0 commit comments

Comments
 (0)