          logger.debug("optimizer kwargs: %s", self._kwargs)
  
  
  class _Loss():
      """ Holds loss names and functions for an Autoencoder.
  
      Parameters
      ----------
      inputs: list
          A list of input tensors to the model in the order ("a", "b")
      outputs: list
          A list of output tensors to the model in the order ("a", "b")
      """
      def __init__(self, inputs, outputs):
          logger.debug("Initializing %s: (inputs: %s, outputs: %s)",
                       self.__class__.__name__, inputs, outputs)
          self._loss_dict = dict(mae=k_losses.mean_absolute_error,
                                 mse=k_losses.mean_squared_error,
                                 logcosh=k_losses.logcosh,
                                 smooth_loss=losses.GeneralizedLoss(),
                                 l_inf_norm=losses.LInfNorm(),
 
</s> remove         selected_loss = self._loss_dict[self._config.get("loss_function", "mae")]
 </s> add         selected_loss = self._loss_dict[self._config["loss_function"]]
        mask_loss = self._loss_dict[self._config["mask_loss_function"]] </s> remove     @property
    def _selected_mask_loss(self):
        """ :func:`keras.losses.Loss`: The selected mask loss function. Currently returns mean
        standard error as the default function. """
        loss_func = self._loss_dict["mse"]
        logger.debug("loss_func: %s", loss_func)
        return loss_func

 </s> add  </s> remove         self._inputs = inputs
        self._names = self._get_loss_names(outputs)
        self._funcs = self._get_loss_functions()
        self._names.insert(0, "total")
 </s> add         self._inputs = None
        self._names = None
        self._funcs = None </s> remove         self.add_item(
            section=section,
            title="mask_type",
            datatype=str,
            default="extended",
            choices=PluginLoader.get_available_extractors("mask", add_none=True),
            group="mask",
            gui_radio=True,
            info="The mask to be used for training. If you have selected 'Learn Mask' or "
                 "'Penalized Mask Loss' you must select a value other than 'none'. The required "
                 "mask should have been selected as part of the Extract process. If it does not "
                 "exist in the alignments file then it will be generated prior to training "
                 "commencing."
                 "\n\tnone: Don't use a mask."
                 "\n\tcomponents: Mask designed to provide facial segmentation based on the "
                 "positioning of landmark locations. A convex hull is constructed around the "
                 "exterior of the landmarks to create a mask."
                 "\n\textended: Mask designed to provide facial segmentation based on the "
                 "positioning of landmark locations. A convex hull is constructed around the "
                 "exterior of the landmarks and the mask is extended upwards onto the forehead."
                 "\n\tvgg-clear: Mask designed to provide smart segmentation of mostly frontal "
                 "faces clear of obstructions. Profile faces and obstructions may result in "
                 "sub-par performance."
                 "\n\tvgg-obstructed: Mask designed to provide smart segmentation of mostly "
                 "frontal faces. The mask model has been specifically trained to recognize "
                 "some facial obstructions (hands and eyeglasses). Profile faces may result in "
                 "sub-par performance."
                 "\n\tunet-dfl: Mask designed to provide smart segmentation of mostly frontal "
                 "faces. The mask model has been trained by community members and will need "
                 "testing for further description. Profile faces may result in sub-par "
                 "performance.")
        self.add_item(
            section=section,
            title="mask_blur_kernel",
            datatype=int,
            min_max=(0, 9),
            rounding=1,
            default=3,
            group="mask",
            info="Apply gaussian blur to the mask input. This has the effect of smoothing the "
                 "edges of the mask, which can help with poorly calculated masks and give less "
                 "of a hard edge to the predicted mask. The size is in pixels (calculated from "
                 "a 128px mask). Set to 0 to not apply gaussian blur. This value should be odd, "
                 "if an even number is passed in then it will be rounded to the next odd number.")
        self.add_item(
            section=section,
            title="mask_threshold",
            datatype=int,
            default=4,
            min_max=(0, 50),
            rounding=1,
            group="mask",
            info="Sets pixels that are near white to white and near black to black. Set to 0 for "
                 "off.")
        self.add_item(
            section=section,
            title="learn_mask",
            datatype=bool,
            default=False,
            group="mask",
            info="Dedicate a portion of the model to learning how to duplicate the input "
                 "mask. Increases VRAM usage in exchange for learning a quick ability to try "
                 "to replicate more complex mask models.")
        self.add_item(
            section=section,
            title="penalized_mask_loss",
            datatype=bool,
            default=True,
            group="loss",
            info="Image loss function is weighted by mask presence. For areas of "
                 "the image without the facial mask, reconstuction errors will be "
                 "ignored while the masked face area is prioritized. May increase "
                 "overall quality by focusing attention on the core face area.")
        self.add_item(
            section=section,
            title="loss_function",
            datatype=str,
            group="loss",
            default="mae",
            choices=["mae", "mse", "logcosh", "smooth_loss", "l_inf_norm", "ssim", "gmsd",
                     "pixel_gradient_diff"],
            info="The loss function to use."
                 "\n\t MAE - Mean absolute error will guide reconstructions of each pixel "
                 "towards its median value in the training dataset. Robust to outliers but as "
                 "a median, it can potentially ignore some infrequent image types in the dataset."
                 "\n\t MSE - Mean squared error will guide reconstructions of each pixel "
                 "towards its average value in the training dataset. As an avg, it will be "
                 "suspectible to outliers and typically produces slightly blurrier results."
                 "\n\t LogCosh - log(cosh(x)) acts similiar to MSE for small errors and to "
                 "MAE for large errors. Like MSE, it is very stable and prevents overshoots "
                 "when errors are near zero. Like MAE, it is robust to outliers. NB: Due to a bug "
                 "in PlaidML, this loss does not work on AMD cards."
                 "\n\t Smooth_L1 --- Modification of the MAE loss to correct two of its "
                 "disadvantages. This loss has improved stability and guidance for small errors."
                 "\n\t L_inf_norm --- The L_inf norm will reduce the largest individual pixel "
                 "error in an image. As each largest error is minimized sequentially, the "
                 "overall error is improved. This loss will be extremely focused on outliers."
                 "\n\t SSIM - Structural Similarity Index Metric is a perception-based "
                 "loss that considers changes in texture, luminance, contrast, and local spatial "
                 "statistics of an image. Potentially delivers more realistic looking images."
                 "\n\t GMSD - Gradient Magnitude Similarity Deviation seeks to match "
                 "the global standard deviation of the pixel to pixel differences between two "
                 "images. Similiar in approach to SSIM. NB: This loss does not currently work on "
                 "AMD cards."
                 "\n\t Pixel_Gradient_Difference - Instead of minimizing the difference between "
                 "the absolute value of each pixel in two reference images, compute the pixel to "
                 "pixel spatial difference in each image and then minimize that difference "
                 "between two images. Allows for large color shifts,but maintains the structure "
                 "of the image.\n")
 </s> add 
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
          logger.debug("optimizer kwargs: %s", self._kwargs)
  
  
  class _Loss():
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
    """ Holds loss names and functions for an Autoencoder. """
    def __init__(self):
        logger.debug("Initializing %s", self.__class__.__name__)
          self._loss_dict = dict(mae=k_losses.mean_absolute_error,
                                 mse=k_losses.mean_squared_error,
                                 logcosh=k_losses.logcosh,
                                 smooth_loss=losses.GeneralizedLoss(),
                                 l_inf_norm=losses.LInfNorm(),
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Training Config - Split Loss to it's own section 
plugins/train/model/_base.py