          ssim = (2 * u_true * u_pred + self.c_1) * (
              2 * covar_true_pred + self.c_2)
          denom = (K.square(u_true) + K.square(u_pred) + self.c_1) * (
              var_pred + var_true + self.c_2)
          ssim /= denom  # no need for clipping, c_1 + c_2 make the denom non-zero
          return K.mean((1.0 - ssim) / 2.0)
  
      @staticmethod
      def _preprocess_padding(padding):
          """Convert keras' padding to tensorflow's padding.
 
</s> remove         # Get std dev
 </s> add         # Get standard deviation </s> remove         """Convert keras' padding to tensorflow's padding.
        # Arguments
            padding: string, `"same"` or `"valid"`.
        # Returns
            a string, `"SAME"` or `"VALID"`.
        # Raises
            ValueError: if `padding` is invalid.
 </s> add         """Convert keras padding to tensorflow padding.

        Parameters
        ----------
        padding: string,
            `"same"` or `"valid"`.

        Returns
        -------
        str
            `"SAME"` or `"VALID"`.

        Raises
        ------
        ValueError
            If `padding` is invalid. </s> remove     def make_kernel(sigma):
 </s> add     def _make_kernel(sigma):
        """ Make the gaussian kernel. """ </s> remove     loss += tv_weight * (generalized_loss(diff_x(y_true), diff_x(y_pred), alpha=1.9999) +
                         generalized_loss(diff_y(y_true), diff_y(y_pred), alpha=1.9999))
    loss += tv2_weight * (generalized_loss(diff_xx(y_true), diff_xx(y_pred), alpha=1.9999) +
                          generalized_loss(diff_yy(y_true), diff_yy(y_pred), alpha=1.9999) +
                          generalized_loss(diff_xy(y_true), diff_xy(y_pred), alpha=1.9999) * 2.)
 </s> add     loss += tv_weight * (generalized_loss(_diff_x(y_true), _diff_x(y_pred), alpha=1.9999) +
                         generalized_loss(_diff_y(y_true), _diff_y(y_pred), alpha=1.9999))
    loss += tv2_weight * (generalized_loss(_diff_xx(y_true), _diff_xx(y_pred), alpha=1.9999) +
                          generalized_loss(_diff_yy(y_true), _diff_yy(y_pred), alpha=1.9999) +
                          generalized_loss(_diff_xy(y_true), _diff_xy(y_pred), alpha=1.9999) * 2.) </s> remove         kernel_1d = np.array([gaussian(x, mean, sigma) for x in range(kernel_size)])
 </s> add         kernel_1d = np.array([_gaussian(x, mean, sigma) for x in range(kernel_size)])
        ssim /= denom  # no need for clipping, c_1 + c_2 make the denorm non-zero
          ssim = (2 * u_true * u_pred + self.c_1) * (
              2 * covar_true_pred + self.c_2)
          denom = (K.square(u_true) + K.square(u_pred) + self.c_1) * (
              var_pred + var_true + self.c_2)
        ssim /= denom  # no need for clipping, c_1 + c_2 make the denorm non-zero
          return K.mean((1.0 - ssim) / 2.0)
  
      @staticmethod
      def _preprocess_padding(padding):
          """Convert keras' padding to tensorflow's padding.
keep keep keep keep replace keep keep keep keep keep
 Simple backend unit tests (#1020)

* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model 
lib/model/losses.py