class_docstr: Wrapper class to adversarially mitigate biases in any pretrained Model.
  
  # Parameters
  
  vocab : `Vocabulary`
      Vocabulary of predictor.
  predictor : `Model`
      Model for which to mitigate biases.
  adversary : `Model`
      Model that attempts to recover protected variable values from predictor's predictions.
  bias_direction : `BiasDirectionWrapper`
      Bias direction used by adversarial bias mitigator.
  predictor_output_key : `str`
      Key corresponding to output in `output_dict` of predictor that should be passed as input
      to adversary.
  
  !!! Note
      adversary must use same vocab as predictor, if it requires a vocab.
code: def __init__(
      self,
      vocab: Vocabulary,
      predictor: Model,
      adversary: Model,
      bias_direction: BiasDirectionWrapper,
      predictor_output_key: str,
      **kwargs,
  ):
      super().__init__(vocab, **kwargs)
  
      self.predictor = predictor
      self.adversary = adversary
  
      # want to keep adversary label hook during evaluation
      embedding_layer = find_embedding_layer(self.predictor)
      self.bias_direction = bias_direction
      self.predetermined_bias_direction = self.bias_direction(
          embedding_layer
      )
      self._adversary_label_hook = _AdversaryLabelHook(
          self.predetermined_bias_direction
      )
      embedding_layer.register_forward_hook(self._adversary_label_hook)
  
      self.vocab = self.predictor.vocab
      self._regularizer = self.predictor._regularizer
  
      self.predictor_output_key = predictor_output_key
  
imports: from typing import Dict, Optional
  import torch
  from allennlp.common.checks import ConfigurationError
  from allennlp.data import Vocabulary
  from allennlp.fairness.bias_direction_wrappers import BiasDirectionWrapper
  from allennlp.modules.feedforward import FeedForward
  from allennlp.models import Model
  from allennlp.nn import InitializerApplicator
  from allennlp.nn.util import find_embedding_layer
  from allennlp.training.callbacks.callback import TrainerCallback
  from allennlp.training.callbacks.backward import OnBackwardException
  from allennlp.training.gradient_descent_trainer import GradientDescentTrainer
label_desc: Use image node_id 1 to create a new AdversarialBiasMitigator object from inherited base classes: Model with example: obj = AdversarialBiasMitigator(vocab, predictor, adversary, bias_direction, predictor_output_key)