parameters: (self, info_state, legal_actions, epsilon)
return_statement: return action, probs
docstring: Returns a valid epsilon-greedy action and valid action probs.
  
      Action probabilities are given by a softmax over legal q-values.
  
      Args:
        info_state: hashable representation of the information state.
        legal_actions: list of legal actions at `info_state`.
        epsilon: float, probability of taking an exploratory action.
  
      Returns:
        A valid epsilon-greedy action and valid action probabilities.
docstring_summary: Returns a valid epsilon-greedy action and valid action probs.
docstring_tokens: Returns a valid epsilon - greedy action and valid action probs .
function: def _epsilon_greedy(self, info_state, legal_actions, epsilon):
      """Returns a valid epsilon-greedy action and valid action probs.
  
      Action probabilities are given by a softmax over legal q-values.
  
      Args:
        info_state: hashable representation of the information state.
        legal_actions: list of legal actions at `info_state`.
        epsilon: float, probability of taking an exploratory action.
  
      Returns:
        A valid epsilon-greedy action and valid action probabilities.
      """
      probs = np.zeros(self._num_actions)
      if np.random.rand() < epsilon:
        action = np.random.choice(legal_actions)
        probs[legal_actions] = 1.0 / len(legal_actions)
      else:
        info_state = torch.Tensor(np.reshape(info_state, [1, -1]))
        q_values = self._q_network(info_state).detach()[0]
        legal_q_values = q_values[legal_actions]
        action = legal_actions[torch.argmax(legal_q_values)]
        probs[action] = 1.0
      return action, probs
function_tokens: def _epsilon_greedy ( self , info_state , legal_actions , epsilon ) : probs = np . zeros ( self . _num_actions ) if np . random . rand ( ) < epsilon : action = np . random . choice ( legal_actions ) probs [ legal_actions ] = 1.0 / len ( legal_actions ) else : info_state = torch . Tensor ( np . reshape ( info_state , [ 1 , - 1 ] ) ) q_values = self . _q_network ( info_state ) . detach ( ) [ 0 ] legal_q_values = q_values [ legal_actions ] action = legal_actions [ torch . argmax ( legal_q_values ) ] probs [ action ] = 1.0 return action , probs