  
          if get_masks:
              logger.debug("Adding masks to training opts dict")
              retval["masks"] = alignments.masks
          logger.debug(retval)
          return retval
  
      def _set_tensorboard(self):
          """ Set up Tensorboard callback for logging loss.
  
 
</s> remove         if get_masks:
 </s> add         if self._model.config["learn_mask"] or self._model.config["penalized_mask_loss"]: </s> remove         get_masks = self._model.config["learn_mask"] or self._model.config["penalized_mask_loss"]
        if not self._model.command_line_arguments.warp_to_landmarks and not get_masks:
 </s> add         if not any([self._model.config["learn_mask"],
                    self._model.config["penalized_mask_loss"],
                    self._model.config["eye_multiplier"] > 1,
                    self._model.config["mouth_multiplier"] > 1,
                    self._model.command_line_arguments.warp_to_landmarks]): </s> remove             Includes the key `landmarks` if landmarks are required for training and the key `masks`
            if the masks are required for training. """
 </s> add             Includes the key `landmarks` if landmarks are required for training, `masks` if masks
            are required for training, `masks_eye` if eye masks are required and `masks_mouth` if
            mouth masks are required. """ </s> remove         loss_functions: list
            A list of either a tuple of (:class:`keras.losses.Loss`, scalar weight) or just a
            :class:`keras.losses.Loss` function. If just the loss function is passed, then the
            weight is assumed to be 1.0 """
        for loss_func in loss_functions:
            if isinstance(loss_func, tuple):
                assert len(loss_func) == 2, "Tuple loss functions should contain 2 items"
                assert isinstance(loss_func[1], float), "weight should be a float"
                func, weight = loss_func
            else:
                func = loss_func
                weight = 1.0
            self._loss_functions.append(func)
            self._loss_weights.append(weight)
        logger.debug("Compiled losses: (functions: %s, weights: %s",
                     self._loss_functions, self._loss_weights)
 </s> add         function: :class:`keras.losses.Loss`
            The loss function to add to the loss chain
        weight: float, optional
            The weighting to apply to the loss function. Default: `1.0`
        mask_channel: int, optional
            The channel in the `y_true` image that the mask exists in. Set to `-1` if there is no
            mask for the given loss function. Default: `-1`
        """
        logger.debug("Adding loss: (function: %s, weight: %s, mask_channel: %s)",
                     function, weight, mask_channel)
        self._loss_functions.append(function)
        self._loss_weights.append(weight)
        self._mask_channels.append(mask_channel) </s> remove         loss_functions: list
            A list of either a tuple of (:class:`keras.losses.Loss`, scalar weight) or just a
            :class:`keras.losses.Loss` function. If just the loss function is passed, then the
            weight is assumed to be 1.0 """
        for loss_func in loss_functions:
            if isinstance(loss_func, tuple):
                assert len(loss_func) == 2, "Tuple loss functions should contain 2 items"
                assert isinstance(loss_func[1], float), "weight should be a float"
                func, weight = loss_func
            else:
                func = loss_func
                weight = 1.0
            self._loss_functions.append(compile_utils.LossesContainer(func))
            self._loss_weights.append(weight)
        logger.debug("Compiled losses: (functions: %s, weights: %s",
                     self._loss_functions, self._loss_weights)
 </s> add         function: :class:`keras.losses.Loss`
            The loss function to add to the loss chain
        weight: float, optional
            The weighting to apply to the loss function. Default: `1.0`
        mask_channel: int, optional
            The channel in the `y_true` image that the mask exists in. Set to `-1` if there is no
            mask for the given loss function. Default: `-1`
        """
        logger.debug("Adding loss: (function: %s, weight: %s, mask_channel: %s)",
                     function, weight, mask_channel)
        self._loss_functions.append(compile_utils.LossesContainer(function))
        self._loss_weights.append(weight)
        self._mask_channels.append(mask_channel)
        if self._model.config["eye_multiplier"] > 1:
            retval["masks_eye"] = alignments.masks_eye

        if self._model.config["mouth_multiplier"] > 1:
            retval["masks_mouth"] = alignments.masks_mouth

        logger.debug({key: {k: len(v) for k, v in val.items()} for key, val in retval.items()})
  
          if get_masks:
              logger.debug("Adding masks to training opts dict")
              retval["masks"] = alignments.masks
        if self._model.config["eye_multiplier"] > 1:
            retval["masks_eye"] = alignments.masks_eye

        if self._model.config["mouth_multiplier"] > 1:
            retval["masks_mouth"] = alignments.masks_mouth

        logger.debug({key: {k: len(v) for k, v in val.items()} for key, val in retval.items()})
          return retval
  
      def _set_tensorboard(self):
          """ Set up Tensorboard callback for logging loss.
  
keep keep keep keep replace keep keep keep keep keep
 Add Mouth and Eye Priority to Loss options (#1054)

* Priority Training for Mouth and Eyes - Tensorflow

* Use chosen loss function for area multipliers

* loss multipliers for AMD

* Fix mask multipliers for plaid and roll PenalizedMaskLoss into LossWrapper

* losses_tf: roll PenalizedMaskLoss into LossWrapper 
plugins/train/trainer/_base.py