          mask = K.expand_dims(y_true[..., mask_channel], axis=-1)
          mask_as_k_inv_prop = 1 - mask_prop
          mask = (mask * mask_prop) + mask_as_k_inv_prop
  
          n_true = K.concatenate([y_true[:, :, :, i:i+1] * mask for i in range(3)], axis=-1)
          n_pred = K.concatenate([y_pred[:, :, :, i:i+1] * mask for i in range(3)], axis=-1)
  
          return n_true, n_pred
 
</s> remove     def _apply_mask(cls, y_true, y_pred, mask_channel, mask_prop=1.0):
 </s> add     def _apply_mask(cls,
                    y_true: tf.Tensor,
                    y_pred: tf.Tensor,
                    mask_channel: int,
                    mask_prop: float = 1.0) -> Tuple[tf.Tensor, tf.Tensor]: </s> remove             self._names.extend(["{}_{}{}".format(name, side,
                                                 "" if output_types.count(name) == 1
                                                 else f"_{idx}")
                                for idx, name in enumerate(output_types)])
 </s> add             for idx, name in enumerate(output_types):
                suffix = "" if output_types.count(name) == 1 else f"_{idx}"
                self._names.append(f"{name}_{side}{suffix}") </s> remove                              self.max_value,
                             filter_size=self.filter_size,
                             filter_sigma=self.filter_sigma,
                             k1=self.k_1,
                             k2=self.k_2)
 </s> add                              self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2) </s> remove         super().__init__(name="DSSIMObjective")
        self.filter_size = filter_size
        self.filter_sigma = filter_sigma
        self.k_1 = k_1
        self.k_2 = k_2
        self.max_value = max_value
 </s> add         super().__init__(name="DSSIMObjective", reduction=tf.keras.losses.Reduction.NONE)
        self._filter_size = filter_size
        self._filter_sigma = filter_sigma
        self._k_1 = k_1
        self._k_2 = k_2
        self._max_value = max_value </s> remove         tensor
            The final loss value
 </s> add         :class:`tensorflow.Tensor`
            The final weighted loss
        n_true = K.concatenate([y_true[..., i:i + 1] * mask for i in range(3)], axis=-1)
        n_pred = K.concatenate([y_pred[..., i:i + 1] * mask for i in range(3)], axis=-1)
          mask = K.expand_dims(y_true[..., mask_channel], axis=-1)
          mask_as_k_inv_prop = 1 - mask_prop
          mask = (mask * mask_prop) + mask_as_k_inv_prop
  
        n_true = K.concatenate([y_true[..., i:i + 1] * mask for i in range(3)], axis=-1)
        n_pred = K.concatenate([y_pred[..., i:i + 1] * mask for i in range(3)], axis=-1)
        n_true = K.concatenate([y_true[..., i:i + 1] * mask for i in range(3)], axis=-1)
        n_pred = K.concatenate([y_pred[..., i:i + 1] * mask for i in range(3)], axis=-1)
  
          return n_true, n_pred
keep keep keep keep replace replace keep keep
 bugfix: distibuted training with dssim 
lib/model/losses_tf.py