class_docstr: Director model that extends TransformerGeneratorModel and adds |V| binary classifier
  heads.
class_docstr_tok: ["Director","model","that","extends","TransformerGeneratorModel","and","adds","|V|","binary","classifier","heads","."]
docstr: Overriding output method to use |V| classifier heads to modify the generator logprobs.
      This modification allows model to incorporate attribute information from classifier for selecting the next tokens.
  Args:
      latent (torch.Tensor): decoder outputs
  
  Returns:
      Modified logprobs.
docstr_tok: ["Overriding","output","method","to","use","|V|","classifier","heads","to","modify","the","generator","logprobs",".","This","modification","allows","model","to","incorporate","attribute","information","from","classifier","for","selecting","the","next","tokens",".","Args",":","latent","(","torch.Tensor",")",":","decoder","outputs","Returns",":","Modified","logprobs","."]
code: def output(self, latent: torch.Tensor):
      """Overriding output method to use |V| classifier heads to modify the generator logprobs.
          This modification allows model to incorporate attribute information from classifier for selecting the next tokens.
      Args:
          latent (torch.Tensor): decoder outputs
  
      Returns:
          Modified logprobs.
      """
      classifier_outputs = F.logsigmoid(self.classifier_output(latent))
      log_predictor_scores = F.log_softmax(
          self.generator_output(latent), dim=-1
      )
  
      scores = (
          log_predictor_scores + self.infer_gamma * classifier_outputs
      )
  
      return F.log_softmax(scores, dim=-1)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from typing import Optional, Any, Dict, Tuple, Union
  from parlai.agents.transformer.modules import TransformerGeneratorModel
  from parlai.agents.transformer.transformer import TransformerGeneratorAgent
  from parlai.core.dict import DictionaryAgent
  from parlai.core.message import Message
  from parlai.core.metrics import AverageMetric
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.core.torch_generator_agent import PPLMetric
  import parlai.utils.logging
label_desc: Use image node_id 4 for calling the DirectorModel obj's underlying member method code with example usage: obj.output(latent) and returns: F