  
      def make_kernel(sigma):
          kernel_size = max(3, int(2 * 2 * sigma + 1))
          mean = np.floor(0.5 * kernel_size)
          kernel_1d = np.array([gaussian(x, mean, sigma) for x in range(kernel_size)])
          np_kernel = np.outer(kernel_1d, kernel_1d).astype(dtype=K.floatx())
          kernel = np_kernel / np.sum(np_kernel)
          return kernel
  
      gauss_kernel = make_kernel(radius)
 
</s> remove     def make_kernel(sigma):
 </s> add     def _make_kernel(sigma):
        """ Make the gaussian kernel. """ </s> remove     gauss_kernel = make_kernel(radius)
 </s> add     gauss_kernel = _make_kernel(radius) </s> remove     """ From https://github.com/iperov/DeepFaceLab
        Used for blurring mask in training """
    def gaussian(var_x, radius, sigma):
 </s> add     """ Apply gaussian blur to an input.

    Used for blurring mask in training.

    Parameters
    ----------
    radius: float, optional
        The kernel radius for applying gaussian blur. Default: `2.0`

    Returns
    -------
    tensor
        The input tensor with gaussian blurring applied

    References
    ----------
    https://github.com/iperov/DeepFaceLab
    """
    def _gaussian(var_x, radius, sigma):
        """ Obtain the gaussian kernel. """ </s> remove         self.c_1 = (self.k1 * self.max_value) ** 2
        self.c_2 = (self.k2 * self.max_value) ** 2
 </s> add         self.c_1 = (self.k_1 * self.max_value) ** 2
        self.c_2 = (self.k_2 * self.max_value) ** 2 </s> remove     def func(input_):
        inputs = [input_[:, :, :, i:i + 1] for i in range(K.int_shape(input_)[-1])]
 </s> add     def func(input_tensor):
        """ Apply gaussian blurring to the input tensor

        Parameters
        ----------
        input_tensor: tensor
            The input to have gaussian blurring applied.

        Returns
        -------
        tensor
            The input with gaussian blurring applied
        """
        inputs = [input_tensor[:, :, :, i:i + 1] for i in range(K.int_shape(input_tensor)[-1])]
        kernel_1d = np.array([_gaussian(x, mean, sigma) for x in range(kernel_size)])
  
      def make_kernel(sigma):
          kernel_size = max(3, int(2 * 2 * sigma + 1))
          mean = np.floor(0.5 * kernel_size)
        kernel_1d = np.array([_gaussian(x, mean, sigma) for x in range(kernel_size)])
          np_kernel = np.outer(kernel_1d, kernel_1d).astype(dtype=K.floatx())
          kernel = np_kernel / np.sum(np_kernel)
          return kernel
  
      gauss_kernel = make_kernel(radius)
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