parameters: (self, generator_loss_fn, discriminator_loss_fn,
                 generator_optimizer, discriminator_optimizer,
                 use_loss_summaries=True,
                 get_hooks_fn=tfgan_train.get_sequential_train_hooks(),
                 name=None)
docstring: `Head` for GAN training.
  
      Args:
        generator_loss_fn: A TFGAN loss function for the generator. Takes a
          `GANModel` and returns a scalar.
        discriminator_loss_fn: Same as `generator_loss_fn`, but for the
        discriminator.
        generator_optimizer: The optimizer for generator updates.
        discriminator_optimizer: Same as `generator_optimizer`, but for the
          discriminator updates.
        use_loss_summaries: If `True`, add loss summaries. If `False`, does not.
          If `None`, uses defaults.
        get_hooks_fn: A function that takes a GANTrainOps tuple and returns a list
          of hooks.
        name: name of the head. If provided, summary and metrics keys will be
          suffixed by `"/" + name`.
docstring_summary: `Head` for GAN training.
docstring_tokens: Head for GAN training .
function: def __init__(self, generator_loss_fn, discriminator_loss_fn,
                 generator_optimizer, discriminator_optimizer,
                 use_loss_summaries=True,
                 get_hooks_fn=tfgan_train.get_sequential_train_hooks(),
                 name=None):
      """`Head` for GAN training.
  
      Args:
        generator_loss_fn: A TFGAN loss function for the generator. Takes a
          `GANModel` and returns a scalar.
        discriminator_loss_fn: Same as `generator_loss_fn`, but for the
        discriminator.
        generator_optimizer: The optimizer for generator updates.
        discriminator_optimizer: Same as `generator_optimizer`, but for the
          discriminator updates.
        use_loss_summaries: If `True`, add loss summaries. If `False`, does not.
          If `None`, uses defaults.
        get_hooks_fn: A function that takes a GANTrainOps tuple and returns a list
          of hooks.
        name: name of the head. If provided, summary and metrics keys will be
          suffixed by `"/" + name`.
      """
      # TODO(joelshor): Validate inputs.
  
      if use_loss_summaries in [True, False]:
        generator_loss_fn = functools.partial(
            generator_loss_fn, add_summaries=use_loss_summaries)
        discriminator_loss_fn = functools.partial(
            discriminator_loss_fn, add_summaries=use_loss_summaries)
      self._generator_loss_fn = generator_loss_fn
      self._discriminator_loss_fn = discriminator_loss_fn
      self._generator_optimizer = generator_optimizer
      self._discriminator_optimizer = discriminator_optimizer
      self._get_hooks_fn = get_hooks_fn
function_tokens: def __init__ ( self , generator_loss_fn , discriminator_loss_fn , generator_optimizer , discriminator_optimizer , use_loss_summaries = True , get_hooks_fn = tfgan_train . get_sequential_train_hooks ( ) , name = None ) : # TODO(joelshor): Validate inputs. if use_loss_summaries in [ True , False ] : generator_loss_fn = functools . partial ( generator_loss_fn , add_summaries = use_loss_summaries ) discriminator_loss_fn = functools . partial ( discriminator_loss_fn , add_summaries = use_loss_summaries ) self . _generator_loss_fn = generator_loss_fn self . _discriminator_loss_fn = discriminator_loss_fn self . _generator_optimizer = generator_optimizer self . _discriminator_optimizer = discriminator_optimizer self . _get_hooks_fn = get_hooks_fn