class_docstr: RPA UL Agent.
  
  Performs unlikelihood such that tokens which lead to misclassification are
  penalized.
class_docstr_tok: ["RPA","UL","Agent",".","Performs","unlikelihood","such","that","tokens","which","lead","to","misclassification","are","penalized","."]
code: def __init__(self, opt, shared=None):
      super().__init__(opt, shared)
      self.pred_logsoftmax = torch.nn.LogSoftmax(dim=2)
      self.character_softmax = F.softmax
      self.top_k = opt["ul_top_k_toks"]
      self.only_wrong_class_toks = opt["only_wrong_class_toks"]
      self.all_wrong_class_toks = opt["all_wrong_class_toks"]
      self.random_toks = opt["random_toks"]
      self.initial_classification_threshold = opt[
          "initial_classification_threshold"
      ]
      if shared:
          self.classifier = shared["classifier"]
      else:
          self.classifier = RPAReranker(opt)
      # set debug to get the full context.
      # we can just as easily decode the full_text_vec, but figured
      # UL is already quite slow so i dont think background preprocessing
      # will yield much speedup
      self.is_debug = True
  
imports: from typing import Optional, List, Tuple
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.torch_agent import Batch
  import torch
  import torch.nn
  import torch.nn.functional
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.torch_agent import Output
  from parlai.core.metrics import AverageMetric
  from projects.light_whoami.agents.rpa_rerank import RPAReranker
  from projects.msc.agents.long_tga import TransformerVariantAgent
label_desc: Use image node_id 1 to create a new RpaUlAgent object from inherited base classes: TransformerGeneratorAgent with example: obj = RpaUlAgent(opt, shared)