class_docstr: An agent that maintains linear reward estimates and their uncertainties.
class_docstr_tok: ["An","agent","that","maintains","linear","reward","estimates","and","their","uncertainties","."]
docstr: Returns the matrix of per-arm feature weights.
  
  The returned matrix has shape (num_actions, context_dim).
  It's equivalent to a stacking of theta vectors from the paper.
code: def theta(self):
      """Returns the matrix of per-arm feature weights.
  
      The returned matrix has shape (num_actions, context_dim).
      It's equivalent to a stacking of theta vectors from the paper.
      """
      thetas = []
      for k in range(self._num_models):
          if self._use_eigendecomp:
              model_index = policy_utilities.get_model_index(
                  k, self._accepts_per_arm_features
              )
              q_t_b = tf.matmul(
                  self.eig_matrix[model_index],
                  tf.expand_dims(
                      self.data_vector[model_index], axis=-1
                  ),
                  transpose_a=True,
              )
              lambda_inv = tf.divide(
                  tf.ones_like(self.eig_vals[model_index]),
                  self.eig_vals[model_index] + self._tikhonov_weight,
              )
              theta_k = tf.squeeze(
                  tf.matmul(
                      self.eig_matrix[model_index],
                      tf.einsum("j,jk->jk", lambda_inv, q_t_b),
                  ),
                  axis=-1,
              )
          else:
              theta_k = tf.squeeze(
                  linalg.conjugate_gradient(
                      self._cov_matrix_list[k]
                      + self._tikhonov_weight
                      * tf.eye(
                          self._overall_context_dim, dtype=self._dtype
                      ),
                      tf.expand_dims(
                          self._data_vector_list[k], axis=-1
                      ),
                  ),
                  axis=-1,
              )
          thetas.append(theta_k)
  
      return tf.stack(thetas, axis=0)
  
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 10 for calling the LinearBanditAgent obj's underlying member method code with example usage: obj.theta() and returns: tf