class_docstr: A collection of variables used by `BernoulliThompsonSamplingAgent`.
class_docstr_tok: ["A","collection","of","variables","used","by","`","BernoulliThompsonSamplingAgent","`","."]
docstr: Initializes an instance of `BernoulliBanditVariableCollection`.
  
  It creates all the variables needed for `BernoulliThompsonSamplingAgent`.
  For each action, the agent maintains the `alpha` and `beta` parameters of
  the beta distribution.
  
  Args:
    num_actions: (int) The number of actions.
    dtype: The type of the variables. Should be one of `tf.float32` or
      `tf.float64`.
    name: (string) the name of this instance.
docstr_tok: ["Initializes","an","instance","of","`","BernoulliBanditVariableCollection","`",".","It","creates","all","the","variables","needed","for","`","BernoulliThompsonSamplingAgent","`",".","For","each","action",",","the","agent","maintains","the","`","alpha","`","and","`","beta","`","parameters","of","the","beta","distribution",".","Args",":","num_actions",":","(","int",")","The","number","of","actions",".","dtype",":","The","type","of","the","variables",".","Should","be","one","of","`","tf.float32","`","or","`","tf.float64","`",".","name",":","(","string",")","the","name","of","this","instance","."]
code: def __init__(
      self,
      num_actions: int,
      dtype: tf.DType = tf.float32,
      name: Optional[Text] = None,
  ):
      """Initializes an instance of `BernoulliBanditVariableCollection`.
  
      It creates all the variables needed for `BernoulliThompsonSamplingAgent`.
      For each action, the agent maintains the `alpha` and `beta` parameters of
      the beta distribution.
  
      Args:
        num_actions: (int) The number of actions.
        dtype: The type of the variables. Should be one of `tf.float32` or
          `tf.float64`.
        name: (string) the name of this instance.
      """
      tf.Module.__init__(self, name=name)
      # It holds the `alpha` parameter of the beta distribution of each arm.
      self.alpha = [
          tf.compat.v2.Variable(
              tf.ones([], dtype=dtype), name="alpha_{}".format(k)
          )
          for k in range(num_actions)
      ]
      # It holds the `beta` parameter of the beta distribution of each arm.
      self.beta = [
          tf.compat.v2.Variable(
              tf.ones([], dtype=dtype), name="beta_{}".format(k)
          )
          for k in range(num_actions)
      ]
  
file_path: agents/tf_agents/bandits/agents/bernoulli_thompson_sampling_agent.py
imports: from typing import Optional, Sequence, Text
  import gin
  import tensorflow
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.bandits.policies import bernoulli_thompson_sampling_policy
  from tf_agents.policies import utils
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 1 to create a new BernoulliBanditVariableCollection object from inherited base classes: tf with example: obj = BernoulliBanditVariableCollection(num_actions, dtype, name)