class_docstr: Neural LinUCB Policy.
  
  Applies LinUCB on top of an encoding network.
  Since LinUCB is a linear method, the encoding network is used to capture the
  non-linear relationship between the context features and the expected rewards.
  The policy starts with exploration based on epsilon greedy and then switches
  to LinUCB for exploring more efficiently.
  
  This policy supports both the global-only observation model and the global and
  per-arm model:
  
  -- In the global-only case, there is one single observation per
     time step, and every arm has its own reward estimation function.
  -- In the per-arm case, all arms receive individual observations, and the
     reward estimation function is identical for all arms.
  
  Reference:
  Carlos Riquelme, George Tucker, Jasper Snoek,
  `Deep Bayesian Bandits Showdown: An Empirical Comparison of Bayesian Deep
  Networks for Thompson Sampling`, ICLR 2018.
class_docstr_tok: ["Neural","LinUCB","Policy",".","Applies","LinUCB","on","top","of","an","encoding","network",".","Since","LinUCB","is","a","linear","method",",","the","encoding","network","is","used","to","capture","the","non-linear","relationship","between","the","context","features","and","the","expected","rewards",".","The","policy","starts","with","exploration","based","on","epsilon","greedy","and","then","switches","to","LinUCB","for","exploring","more","efficiently",".","This","policy","supports","both","the","global-only","observation","model","and","the","global","and","per-arm","model",":","--","In","the","global-only","case",",","there","is","one","single","observation","per","time","step",",","and","every","arm","has","its","own","reward","estimation","function",".","--","In","the","per-arm","case",",","all","arms","receive","individual","observations",",","and","the","reward","estimation","function","is","identical","for","all","arms",".","Reference",":","Carlos","Riquelme",",","George","Tucker",",","Jasper","Snoek",",","`","Deep","Bayesian","Bandits","Showdown",":","An","Empirical","Comparison","of","Bayesian","Deep","Networks","for","Thompson","Sampling","`",",","ICLR","2018","."]
code: def _get_encoded_observation_for_arm(
      self, encoded_observation: types.Float, arm_index: int
  ) -> types.Float:
      if self._accepts_per_arm_features:
          return encoded_observation[:, arm_index, :]
      else:
          return encoded_observation
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Sequence, Text, Tuple
  import tensorflow
  import tensorflow_probability
  from tf_agents.bandits.policies import constraints
  from tf_agents.bandits.policies import linalg
  from tf_agents.bandits.specs import utils
  from tf_agents.distributions import masked
  from tf_agents.policies import tf_policy
  from tf_agents.policies import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.typing import types
label_desc: Use image node_id 7 for calling the NeuralLinUCBPolicy obj's underlying member method code with example usage: obj._get_encoded_observation_for_arm(encoded_observation, arm_index) and returns: encoded_observation, encoded_observation