Select an action with an epsilon-greedy policy. Draw one random value u from a generator initialized with seed:
a={uniform random action,argmaxjqj,u<εu≥εHere, ε is the exploration probability and qj is the value of action j. NumPy argmax resolves greedy ties by choosing the first maximum. Return the selected action index as a Python integer.
Input: q_values = [1, 2, 0.5], epsilon = 0, seed = 0
Output: 1
Explanation: With zero exploration probability, the action with the largest value is selected.
Input: q_values = [1, 2, 0.5], epsilon = 1, seed = 42
Output: 1
Create the generator with rng = np.random.default_rng(seed).
Use rng.integers(values.size) for exploration and np.argmax(values) otherwise.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number
Select an action with an epsilon-greedy policy. Draw one random value u from a generator initialized with seed:
a={uniform random action,argmaxjqj,u<εu≥εHere, ε is the exploration probability and qj is the value of action j. NumPy argmax resolves greedy ties by choosing the first maximum. Return the selected action index as a Python integer.
Input: q_values = [1, 2, 0.5], epsilon = 0, seed = 0
Output: 1
Explanation: With zero exploration probability, the action with the largest value is selected.
Input: q_values = [1, 2, 0.5], epsilon = 1, seed = 42
Output: 1
Create the generator with rng = np.random.default_rng(seed).
Use rng.integers(values.size) for exploration and np.argmax(values) otherwise.
Sign in to take notes on this problem
Accepts: array
Accepts: number
Accepts: number