  from dataclasses import dataclass
  
  from typing import Dict, List, Optional, Tuple, Union
  
  if sys.version_info < (3, 8):
      from typing_extensions import Literal
  else:
      from typing import Literal
  
  import numpy as np
  
  from lib.model.nn_blocks import (
      Conv2D, Conv2DBlock, Conv2DOutput, ResidualBlock, UpscaleBlock, Upscale2xBlock,
      UpscaleResizeImagesBlock, UpscaleDNYBlock)
 
</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         size = int(max(min_size, min(default_size, ((default_size * scaling) // 16) * 16)))
 </s> add         size = int(max(min_size, ((default_size * scaling) // 16) * 16))
  from dataclasses import dataclass
  
  from typing import Dict, List, Optional, Tuple, Union
  





  import numpy as np
  
  from lib.model.nn_blocks import (
      Conv2D, Conv2DBlock, Conv2DOutput, ResidualBlock, UpscaleBlock, Upscale2xBlock,
      UpscaleResizeImagesBlock, UpscaleDNYBlock)
keep keep keep keep replace replace replace 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/phaze_a.py