def select_action(self, q_values):
<EOL>assert self.agent.training, "<STR_LIT>"<EOL>assert q_values.ndim == <NUM_LIT:1>, q_values.ndim<EOL>q_values = q_values.astype('<STR_LIT>')<EOL>if self.agent.step == <NUM_LIT:0>:<EOL><INDENT>self.action_counts = np.ones(q_values.shape)<EOL><DEDENT>assert self.action_counts is not None, self.agent.step<EOL>assert self.action_counts.shape == q_values.shape, (self.action_counts.shape, q_values.shape)<EOL>beta = self.C/np.sqrt(self.action_counts)<EOL>Z = np.random.gumbel(size=q_values.shape)<EOL>perturbation = beta * Z<EOL>perturbed_q_values = q_values + perturbation<EOL>action = np.argmax(perturbed_q_values)<EOL>self.action_counts[action] += <NUM_LIT:1><EOL>return action<EOL>
Return the selected action

        # Arguments
            q_values (np.ndarray): List of the estimations of Q for each action

        # Returns
            Selection action