              The DSSIM Loss value
          """
          ssim = tf.image.ssim(y_true,
                               y_pred,
                               self.max_value,
                               filter_size=self.filter_size,
                               filter_sigma=self.filter_sigma,
                               k1=self.k_1,
                               k2=self.k_2)
          dssim_loss = (1. - ssim) / 2.0
          return dssim_loss
  
  
  class MSSSIMLoss(tf.keras.losses.Loss):  # pylint:disable=too-few-public-methods
 
</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     def __init__(self):
 </s> add     def __init__(self) -> None: </s> remove         tensor
            The final loss value
 </s> add         :class:`tensorflow.Tensor`
            The final weighted loss </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         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)
 </s> add         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)
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
              The DSSIM Loss value
          """
          ssim = tf.image.ssim(y_true,
                               y_pred,
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
                             self._max_value,
                             filter_size=self._filter_size,
                             filter_sigma=self._filter_sigma,
                             k1=self._k_1,
                             k2=self._k_2)
          dssim_loss = (1. - ssim) / 2.0
          return dssim_loss
  
  
  class MSSSIMLoss(tf.keras.losses.Loss):  # pylint:disable=too-few-public-methods
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 bugfix: distibuted training with dssim 
lib/model/losses_tf.py