          bool
              ``True`` if legacy items exist and state file has been updated, otherwise ``False``
          """
          logger.debug("Checking for legacy state file update")
          priors = ["dssim_loss", "mask_type", "mask_type"]
          new_items = ["loss_function", "learn_mask", "mask_type"]
          updated = False
          for old, new in zip(priors, new_items):
              if old not in self._config:
                  logger.debug("Legacy item '%s' not in config. Skipping update", old)
                  continue
 
</s> remove         face_loss = self._loss_dict[self._config["loss_function"]]
 </s> add         face_losses = [(self._loss_dict[v], self._config.get(f"loss_weight_{k[-1]}", 100))
                       for k, v in sorted(self._config.items())
                       if k.startswith("loss_function")
                       and self._config.get(f"loss_weight_{k[-1]}", 100) != 0
                       and v is not None] </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                 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.)
        priors = ["dssim_loss", "mask_type", "mask_type", "l2_reg_term"]
        new_items = ["loss_function", "learn_mask", "mask_type", "loss_function_2"]
          bool
              ``True`` if legacy items exist and state file has been updated, otherwise ``False``
          """
          logger.debug("Checking for legacy state file update")
        priors = ["dssim_loss", "mask_type", "mask_type", "l2_reg_term"]
        new_items = ["loss_function", "learn_mask", "mask_type", "loss_function_2"]
        priors = ["dssim_loss", "mask_type", "mask_type", "l2_reg_term"]
        new_items = ["loss_function", "learn_mask", "mask_type", "loss_function_2"]
          updated = False
          for old, new in zip(priors, new_items):
              if old not in self._config:
                  logger.debug("Legacy item '%s' not in config. Skipping update", old)
                  continue
keep keep keep keep replace 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/model.py