          logger.trace("dict_key: %s, attribute_name: %s", dict_key, retval)
          return retval
  
  
  class BlurMask():
      """ Factory class to return the correct blur object for requested blur type.
  
      Works for square images only. Currently supports Gaussian and Normalized Box Filters.
  
      Parameters
 
</s> remove class TrainingDataGenerator():
 </s> add class TrainingDataGenerator():  # pylint:disable=too-few-public-methods </s> remove     single output.

    Parameters
    ----------
    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 """
    def __init__(self, loss_functions):
        logger.debug("Initializing: %s: (loss_functions: %s)",
                     self.__class__.__name__, loss_functions)
 </s> add     single output and masking.
    """
    def __init__(self):
        logger.debug("Initializing: %s", self.__class__.__name__) </s> remove 
    Parameters
    ----------
    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 """
    def __init__(self, loss_functions):
        logger.debug("Initializing: %s: (loss_functions: %s)",
                     self.__class__.__name__, loss_functions)
 </s> add     """
    def __init__(self):
        logger.debug("Initializing: %s", self.__class__.__name__) </s> remove class PenalizedLoss(tf.keras.losses.Loss):
    """ Penalized Loss function.

    Applies the given loss function just to the masked area of the image.

    Parameters
    ----------
    loss_func: function
        The actual loss function to use
    mask_prop: float, optional
        The amount of mask propagation. Default: `1.0`
    """
    def __init__(self, loss_func, mask_prop=1.0):
        super().__init__(name="penalized_loss")
        self._loss_func = compile_utils.LossesContainer(loss_func)
        self._mask_prop = mask_prop

    def call(self, y_true, y_pred):
        """ Apply the loss function to the masked area of the image.

        Parameters
        ----------
        y_true: tensor or variable
            The ground truth value. This should contain the mask in the 4th channel that will be
            split off for penalizing.
        y_pred: tensor or variable
            The predicted value

        Returns
        -------
        tensor
            The Loss value
        """
        mask = self._prepare_mask(K.expand_dims(y_true[..., -1], axis=-1))
        y_true = y_true[..., :-1]
        n_true = K.concatenate([y_true[:, :, :, i:i+1] * mask for i in range(3)], axis=-1)
        n_pred = K.concatenate([y_pred[:, :, :, i:i+1] * mask for i in range(3)], axis=-1)
        return self._loss_func(n_true, n_pred)

    def _prepare_mask(self, mask):
        """ Prepare the masks for calculating loss

        Parameters
        ----------
        mask: :class:`numpy.ndarray`
            The masks for the current batch

        Returns
        -------
        tensor
            The prepared mask for applying to loss
        """
        mask_as_k_inv_prop = 1 - self._mask_prop
        mask = (mask * self._mask_prop) + mask_as_k_inv_prop
        return mask


 </s> add  </s> remove             This should be a 4-dimensional array of training images in the format (`batchsize`,
 </s> add             This should be a 4+-dimensional array of training images in the format (`batchsize`,
class BlurMask():  # pylint:disable=too-few-public-methods
          logger.trace("dict_key: %s, attribute_name: %s", dict_key, retval)
          return retval
  
  
class BlurMask():  # pylint:disable=too-few-public-methods
      """ Factory class to return the correct blur object for requested blur type.
  
      Works for square images only. Currently supports Gaussian and Normalized Box Filters.
  
      Parameters
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 
lib/faces_detect.py