class_docstr: A collection of variables used by `LinearBanditAgent`.
class_docstr_tok: ["A","collection","of","variables","used","by","`","LinearBanditAgent","`","."]
docstr: Initializes an instance of `LinearBanditVariableCollection`.
  
  It creates all the variables needed for `LinearBanditAgent`.
  
  Args:
    context_dim: (int) The context dimension of the bandit environment the
      agent will be used on.
    num_models: (int) The number of models maintained by the agent. This is
      either the same as the number of arms, or, if the agent accepts per-arm
      features, 1.
    use_eigendecomp: (bool) Whether the agent uses eigen decomposition for
      maintaining its internal state.
    dtype: The type of the variables. Should be one of `tf.float32` and
      `tf.float64`.
    name: (string) the name of this instance.
code: def __init__(
      self,
      context_dim: int,
      num_models: int,
      use_eigendecomp: bool = False,
      dtype: tf.DType = tf.float32,
      name: Optional[Text] = None,
  ):
      """Initializes an instance of `LinearBanditVariableCollection`.
  
      It creates all the variables needed for `LinearBanditAgent`.
  
      Args:
        context_dim: (int) The context dimension of the bandit environment the
          agent will be used on.
        num_models: (int) The number of models maintained by the agent. This is
          either the same as the number of arms, or, if the agent accepts per-arm
          features, 1.
        use_eigendecomp: (bool) Whether the agent uses eigen decomposition for
          maintaining its internal state.
        dtype: The type of the variables. Should be one of `tf.float32` and
          `tf.float64`.
        name: (string) the name of this instance.
      """
      tf.Module.__init__(self, name=name)
      self.theta = tf.compat.v2.Variable(
          tf.zeros([num_models, context_dim], dtype=dtype), name="theta"
      )
      self.cov_matrix_list = []
      self.data_vector_list = []
      self.eig_matrix_list = []
      self.eig_vals_list = []
      self.num_samples_list = []
      for k in range(num_models):
          self.cov_matrix_list.append(
              tf.compat.v2.Variable(
                  tf.zeros([context_dim, context_dim], dtype=dtype),
                  name="a_" + str(k),
              )
          )
          self.data_vector_list.append(
              tf.compat.v2.Variable(
                  tf.zeros(context_dim, dtype=dtype),
                  name="b_{}".format(k),
              )
          )
          self.num_samples_list.append(
              tf.compat.v2.Variable(
                  tf.zeros([], dtype=dtype),
                  name="num_samples_{}".format(k),
              )
          )
          if use_eigendecomp:
              self.eig_matrix_list.append(
                  tf.compat.v2.Variable(
                      tf.eye(context_dim, dtype=dtype),
                      name="eig_matrix{}".format(k),
                  )
              )
              self.eig_vals_list.append(
                  tf.compat.v2.Variable(
                      tf.zeros([context_dim], dtype=dtype),
                      name="eig_vals{}".format(k),
                  )
              )
          else:
              self.eig_matrix_list.append(
                  tf.compat.v2.Variable(
                      tf.constant([], dtype=dtype),
                      name="eig_matrix{}".format(k),
                  )
              )
              self.eig_vals_list.append(
                  tf.compat.v2.Variable(
                      tf.constant([], dtype=dtype),
                      name="eig_vals{}".format(k),
                  )
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Optional, Sequence, Text, Tuple
  import gin
  import tensorflow
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.bandits.agents import utils
  from tf_agents.bandits.policies import linalg
  from tf_agents.bandits.policies import linear_bandit_policy
  from tf_agents.bandits.specs import utils
  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 LinearBanditVariableCollection object from inherited base classes: tf with example: obj = LinearBanditVariableCollection(context_dim, num_models, use_eigendecomp, dtype, name)