          """ Build and return Optimizer """
          opt_kwargs = dict(lr=lr, beta_1=beta_1, beta_2=beta_2)
          if (self.config.get("clipnorm", False) and
                  keras.backend.backend() != "plaidml.keras.backend"):
              # NB: Clipnorm is ballooning VRAM useage, which is not expected behaviour
              # and may be a bug in Keras/TF.
              # PlaidML has a bug regarding the clipnorm parameter
              # See: https://github.com/plaidml/plaidml/issues/228
              # Workaround by simply removing it.
              # TODO: Remove this as soon it is fixed in PlaidML.
 
</s> remove         if self.pingpong.active:
 </s> add         if self._pingpong.active: </s> remove     """ The training process.  """
 </s> add     """ The Faceswap Training Process.

    The training process is responsible for training a model on a set of source faces and a set of
    destination faces.

    The training process is self contained and should not be referenced by any other scripts, so it
    contains no public properties.

    Parameters
    ----------
    arguments: argparse.Namespace
        The arguments to be passed to the training process as generated from Faceswap's command
        line arguments
    """ </s> remove     def tensorboard_kwargs(self):
        """ TF 1.13 + needs an additional kwarg which is not valid for earlier versions """
 </s> add     def _tensorboard_kwargs(self):
        """ dict: The keyword arguments to be passed to :class:`tf.keras.callbacks.TensorBoard`.
        NB: Tensorflow 1.13 + needs an additional keyword argument which is not valid for earlier
        versions """ </s> remove         self._mask_class = self._set__mask_class()
 </s> add 
            # NB: Clipnorm is ballooning VRAM usage, which is not expected behavior
          """ Build and return Optimizer """
          opt_kwargs = dict(lr=lr, beta_1=beta_1, beta_2=beta_2)
          if (self.config.get("clipnorm", False) and
                  keras.backend.backend() != "plaidml.keras.backend"):
            # NB: Clipnorm is ballooning VRAM usage, which is not expected behavior
              # and may be a bug in Keras/TF.
              # PlaidML has a bug regarding the clipnorm parameter
              # See: https://github.com/plaidml/plaidml/issues/228
              # Workaround by simply removing it.
              # TODO: Remove this as soon it is fixed in PlaidML.
keep keep keep keep replace keep keep keep keep keep
 Smart Masks - Training Implementation (#914)

* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models. 
plugins/train/model/_base.py