class_docstr: Computes an epsilon-greedy distribution over actions.
  
  This policy does the following:
  - With probability 1 - epsilon, take the action corresponding to the highest
  action value, breaking ties uniformly at random.
  - With probability epsilon, take an action uniformly at random.
docstr: Initialize the policy.
  
  Args:
    epsilon: Exploratory param with value between 0 and 1.
    threshold: Action values must exceed this value to qualify as a legal
      action and possibly be selected by the policy.
    name: Name of the network.
  
  Returns:
    policy: tfp.distributions.Categorical distribution representing the
      policy.
docstr_tok: ["Initialize","the","policy",".","Args",":","epsilon",":","Exploratory","param","with","value","between","0","and","1.","threshold",":","Action","values","must","exceed","this","value","to","qualify","as","a","legal","action","and","possibly","be","selected","by","the","policy",".","name",":","Name","of","the","network",".","Returns",":","policy",":","tfp.distributions.Categorical","distribution","representing","the","policy","."]
code: def __init__(
      self,
      epsilon: Union[tf.Tensor, float],
      threshold: float,
      name: str = "EpsilonGreedy",
  ):
      """Initialize the policy.
  
      Args:
        epsilon: Exploratory param with value between 0 and 1.
        threshold: Action values must exceed this value to qualify as a legal
          action and possibly be selected by the policy.
        name: Name of the network.
  
      Returns:
        policy: tfp.distributions.Categorical distribution representing the
          policy.
      """
      super().__init__(name=name)
      self._epsilon = tf.Variable(epsilon, trainable=False)
      self._threshold = threshold
  
file_path: acme/acme/tf/networks/legal_actions.py
imports: from typing import Any, Callable, Iterable, Optional, Union
  from acme.wrappers import open_spiel_wrapper
  import numpy
  import sonnet
  import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 1 to create a new EpsilonGreedy object from inherited base classes: snt with example: obj = EpsilonGreedy(epsilon, threshold, name)