                                 ssim=losses.DSSIMObjective(),
                                 ms_ssim=losses.MSSSIMLoss(),
                                 gmsd=losses.GMSDLoss(),
                                 pixel_gradient_diff=losses.GradientLoss())
          self._uses_l2_reg = ["ssim", "ms_ssim", "gmsd"]
          self._mask_channels = self._get_mask_channels()
          self._inputs: List[keras.layers.Layer] = []
          self._names: List[str] = []
          self._funcs: Dict[str, Callable] = {}
          logger.debug("Initialized: %s", self.__class__.__name__)
 
</s> remove         if self._config["loss_function"] in self._uses_l2_reg and self._config["l2_reg_term"] > 0:
            logger.debug("Adding L2 Regularization for Structural Loss")
            loss_wrapper.add_loss(self._loss_dict["mse"],
                                  weight=self._config["l2_reg_term"] / 100.0,
                                  mask_channel=mask_channel)
 </s> add         logger.debug("Adding loss function: %s, weight: %s", loss_function, weight)
        loss_wrapper.add_loss(loss_function,
                              weight=weight,
                              mask_channel=self._mask_channels[0])

        channel_idx = 1
        for section in ("eye_multiplier", "mouth_multiplier"):
            mask_channel = self._mask_channels[channel_idx]
            multiplier = self._config[section] * 1.
            if multiplier > 1.:
                logger.debug("Adding section loss %s: %s", section, multiplier)
                loss_wrapper.add_loss(loss_function,
                                      weight=weight * multiplier,
                                      mask_channel=mask_channel)
            channel_idx += 1 </s> remove         mask = K.expand_dims(y_true[..., mask_channel], axis=-1)
 </s> add         mask = K.tile(K.expand_dims(y_true[..., mask_channel], axis=-1), (1, 1, 1, 3)) </s> remove         mask = K.expand_dims(y_true[..., mask_channel], axis=-1)
 </s> add         mask = K.tile(K.expand_dims(y_true[..., mask_channel], axis=-1), (1, 1, 1, 3)) </s> remove                 loss_func.add_loss(face_loss, mask_channel=self._mask_channels[0])
                self._add_l2_regularization_term(loss_func, self._mask_channels[0])

                channel_idx = 1
                for multiplier in ("eye_multiplier", "mouth_multiplier"):
                    mask_channel = self._mask_channels[channel_idx]
                    if self._config[multiplier] > 1:
                        loss_func.add_loss(face_loss,
                                           weight=self._config[multiplier] * 1.0,
                                           mask_channel=mask_channel)
                        self._add_l2_regularization_term(loss_func, mask_channel)
                    channel_idx += 1
 </s> add                 for func, weight in face_losses:
                    self._add_face_loss_function(loss_func, func, weight / 100.)
                                 ssim=losses.DSSIMObjective(),
                                 ms_ssim=losses.MSSSIMLoss(),
                                 gmsd=losses.GMSDLoss(),
                                 pixel_gradient_diff=losses.GradientLoss())

          self._mask_channels = self._get_mask_channels()
          self._inputs: List[keras.layers.Layer] = []
          self._names: List[str] = []
          self._funcs: Dict[str, Callable] = {}
          logger.debug("Initialized: %s", self.__class__.__name__)
keep keep keep keep replace keep keep keep keep keep
 Training updates
  - Add multiple selected loss functions
  - Unlock loss as a model configuration
  - Phaze-A remove encoder scaling max xap 
plugins/train/model/_base/settings.py