class_docstr: The trainer with a supervised learning loss. Supports Cross-Entropy, MSE and MAE losses.
  
  Args:
      policy: The policy to be trained.
code: def cb_training_step(
      self, batch: CBInput, batch_idx: int, optimizer_idx: int = 0
  ) -> torch.Tensor:
      assert batch.label is not None  # to satisfy Pyre
  
      # compute the NN loss
      model_output = self.scorer(batch.features_of_chosen_arm)
      pred_label = model_output["pred_label"]
  
      # The supervised learning model outputs predicted label with no uncertainty(uncertainty=ucb_alpha*pred_sigma).
      # weighted average loss
      losses = self.loss(
          pred_label, batch.label.squeeze(-1), reduction="none"
      )
      weight = batch.effective_weight
      return (losses * weight.squeeze(-1)).sum() / losses.shape[0]
  
file_path: ReAgent/reagent/training/cb/supervised_trainer.py
imports: import logging
  import torch
  from reagent.core.types import CBInput
  from reagent.gym.policies.policy import Policy
  from reagent.training.cb.base_trainer import BaseCBTrainerWithEval
label_desc: Use image node_id 3 for calling the SupervisedTrainer obj's underlying member method code with example usage: obj.cb_training_step(batch, batch_idx, optimizer_idx) and returns: unknown