  
          split = len(loss) // 2
          combined_loss = [sum(loss[:split]), sum(loss[split:])]
          self._model.add_history(combined_loss)
          logger.trace("original loss: %s, comibed_loss: %s", loss, combined_loss)
          return combined_loss
  
      def _print_loss(self, loss):
          """ Outputs the loss for the current iteration to the console.
  
 
</s> remove     def _print_loss(self, loss):
 </s> add     def _print_loss(self, loss: List[float]) -> None: </s> remove     def _collate_and_store_loss(self, loss):
 </s> add     def _collate_and_store_loss(self, loss: List[float]) -> List[float]: </s> remove             The list of loss ``floats`` for this iteration.
 </s> add             The list of loss ``floats`` for each side this iteration (excluding total combined
            loss) </s> remove         Parameters
        ----------
        training_size: int
             The size of the training images stored on disk that are to be fed into
             :class:`ImageAugmentation`. The training images should always be square and of the
             same size. This is the size, in pixels, of the `width` and the `height` of the
             training images.
         """
        logger.debug("Initializing constants. training_size: %s", training_size)
        self._training_size = training_size
        coverage = int(self._training_size * self._coverage_ratio // 2) * 2
 </s> add         # Transform
        tform_shift = (int(self._config.get("shift_range", 5)) / 100) * self._processing_size </s> remove             batch = next(self._feeds[side])
            side_inputs = batch["feed"]
            side_targets = self._compile_mask_targets(batch["targets"],
                                                      batch["masks"],
                                                      batch.get("additional_masks", None))
            if self._model.config["learn_mask"]:
                side_targets = side_targets + [batch["masks"]]
            logger.trace("side: %s, input_shapes: %s, target_shapes: %s",
                         side, [i.shape for i in side_inputs], [i.shape for i in side_targets])
            if get_backend() == "amd":
                model_inputs.extend(side_inputs)
                model_targets.extend(side_targets)
            else:
                model_inputs.append(side_inputs)
                model_targets.append(side_targets)
        return model_inputs, model_targets
 </s> add             side_feed, side_targets = next(self._feeds[side])
            if self._model.config["learn_mask"]:  # Add the face mask as it's own target
                side_targets += [side_targets[-1][..., 3][..., None]]
            logger.trace("side: %s, input_shapes: %s, target_shapes: %s",  # type: ignore
                         side, side_feed.shape, [i.shape for i in side_targets])
            model_inputs.append([side_feed])
            model_targets.append(side_targets)
        logger.trace("original loss: %s, combined_loss: %s", loss, combined_loss)  # type: ignore
  
          split = len(loss) // 2
          combined_loss = [sum(loss[:split]), sum(loss[split:])]
          self._model.add_history(combined_loss)
        logger.trace("original loss: %s, combined_loss: %s", loss, combined_loss)  # type: ignore
          return combined_loss
  
      def _print_loss(self, loss):
          """ Outputs the loss for the current iteration to the console.
  
keep keep keep keep replace keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
plugins/train/trainer/_base.py