Skip to content

Commit 7e0ef36

Browse files
committed
update docs
1 parent 5b9fcd9 commit 7e0ef36

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tensorlayer/rein.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,25 @@ def choice_action_by_probs(probs=[0.5, 0.5], action_list=None):
9292
------------
9393
probs : a list of float.
9494
The probability distribution of all actions.
95-
action_list : None or a list of action in integer.
96-
If None, return an integer range between 0 and len(probs)-1.
95+
action_list : None or a list of action in integer, string or others.
96+
If None, returns an integer range between 0 and len(probs)-1.
9797
9898
Examples
9999
----------
100100
>>> for _ in range(5):
101-
>>> a = choice_action_by_probs(probs=[0.2, 0.4, 0.4])
101+
>>> a = choice_action_by_probs([0.2, 0.4, 0.4])
102102
>>> print(a)
103103
... 0
104104
... 1
105105
... 1
106106
... 2
107107
... 1
108+
>>> for _ in range(3):
109+
>>> a = choice_action_by_probs([0.5, 0.5], ['a', 'b'])
110+
>>> print(a)
111+
... a
112+
... b
113+
... b
108114
"""
109115
if action_list is None:
110116
n_action = len(probs)

0 commit comments

Comments
 (0)