          """ Load the trainer requested for training """
          logger.debug("Loading Trainer")
          trainer = PluginLoader.get_trainer(model.trainer)
          trainer = trainer(model,
                            self.images,
                            self.args.batch_size,
                            self.args.configfile)
          logger.debug("Loaded Trainer")
          return trainer
  
      def run_training_cycle(self, model, trainer):
          """ Perform the training cycle """
 
</s> remove     def load_trainer(self, model):
        """ Load the trainer requested for training """
 </s> add         Returns
        -------
        :file:`plugins.train.trainer` plugin
            The requested model trainer plugin
        """ </s> remove     def run_training_cycle(self, model, trainer):
        """ Perform the training cycle """
 </s> add     def _run_training_cycle(self, model, trainer):
        """ Perform the training cycle.

        Handles the background training, updating previews/time-lapse on each save interval,
        and saving the model.

        Parameters
        ----------
        model: :file:`plugins.train.model` plugin
            The requested model plugin
        trainer: :file:`plugins.train.trainer` plugin
            The requested model trainer plugin
        """ </s> remove     @property
    def alignments_paths(self):
        """ Set the alignments path to input folder if not provided """
        alignments_paths = dict()
        for side in ("a", "b"):
            alignments_path = getattr(self.args, "alignments_path_{}".format(side))
            if not alignments_path:
                image_path = getattr(self.args, "input_{}".format(side))
                alignments_path = os.path.join(image_path, "alignments.fsa")
            alignments_paths[side] = alignments_path
        logger.debug("Alignments paths: %s", alignments_paths)
        return alignments_paths
 </s> add         Parameters
        ----------
        model: :file:`plugins.train.model` plugin
            The requested model plugin </s> remove     @property
    def image_size(self):
        """ Get the training set image size for storing in model data """
        image = read_image(self.images["a"][0], raise_error=True)
        size = image.shape[0]
        logger.debug("Training image size: %s", size)
        return size
 </s> add     def _load_trainer(self, model):
        """ Load the trainer requested for training. </s> remove         if self.args.write_image or self.args.redirect_gui or self.args.preview:
            display_func = self.show
 </s> add         if self._args.write_image or self._args.redirect_gui or self._args.preview:
            display_func = self._show
                          self._images,
                          self._args.batch_size,
                          self._args.configfile)
          """ Load the trainer requested for training """
          logger.debug("Loading Trainer")
          trainer = PluginLoader.get_trainer(model.trainer)
          trainer = trainer(model,
                          self._images,
                          self._args.batch_size,
                          self._args.configfile)
                          self._images,
                          self._args.batch_size,
                          self._args.configfile)
                          self._images,
                          self._args.batch_size,
                          self._args.configfile)
          logger.debug("Loaded Trainer")
          return trainer
  
      def run_training_cycle(self, model, trainer):
          """ Perform the training cycle """
keep keep keep keep replace replace 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. 
scripts/train.py