class_docstr: The trainer for a Contextual Bandit model, where deep represent layer serves as feature processor,
  and then processed features are fed to LinUCB layer to produce UCB score.
  This is extension of LinUCBTrainer. More details refer to docstring of LinUCBTrainer.
  
  Reference:
  - LinUCB : https://arxiv.org/pdf/1003.0146.pdf
  - DeepRepresentLinUCB : https://arxiv.org/pdf/2012.01780.pdf
class_docstr_tok: ["The","trainer","for","a","Contextual","Bandit","model",",","where","deep","represent","layer","serves","as","feature","processor",",","and","then","processed","features","are","fed","to","LinUCB","layer","to","produce","UCB","score",".","This","is","extension","of","LinUCBTrainer",".","More","details","refer","to","docstring","of","LinUCBTrainer",".","Reference",":","-","LinUCB",":","https",":","\/\/arxiv.org\/pdf\/1003.0146.pdf","-","DeepRepresentLinUCB",":","https",":","\/\/arxiv.org\/pdf\/2012.01780.pdf"]
code: def __init__(
      self,
      policy: Policy,
      lr: float = 1e-3,
      weight_decay: float = 0.0,
      loss_type: str = "mse",  # one of the LOSS_TYPES names
      **kwargs,
  ):
      super().__init__(
          automatic_optimization=True,
          policy=policy,
          **kwargs,
      )
      assert isinstance(
          policy.scorer, DeepRepresentLinearRegressionUCB
      ), "Trainer requires the policy scorer to be DeepRepresentLinearRegressionUCB"
      self.scorer = policy.scorer
      self.loss_fn = LOSS_TYPES[loss_type]
      self.lr = lr
      self.weight_decay = weight_decay
  
file_path: ReAgent/reagent/training/cb/deep_represent_linucb_trainer.py
imports: import logging
  import torch
  from reagent.core.configuration import resolve_defaults
  from reagent.core.types import CBInput
  from reagent.gym.policies.policy import Policy
  from reagent.models.deep_represent_linucb import DeepRepresentLinearRegressionUCB
  from reagent.training.cb.linucb_trainer import LinUCBTrainer
  from reagent.training.cb.supervised_trainer import LOSS_TYPES
label_desc: Use image node_id 1 to create a new DeepRepresentLinUCBTrainer object from inherited base classes: LinUCBTrainer with example: obj = DeepRepresentLinUCBTrainer(policy, lr, weight_decay, loss_type)