  
      def get_kernel_size(self, radius_ratio):
          """ Set the kernel size to absolute """
          mask_diameter = np.sqrt(np.sum(self.mask))
          radius = max(1, round(mask_diameter * radius_ratio / 100))
          kernel_size = int((radius * 2) + 1)
          logger.trace("kernel_size: %s", kernel_size)
          return kernel_size
  
      @staticmethod
      def get_kernel_tuple(kernel_size):
 
</s> remove         var_x = (var_x + 1) / 2 * 255  # channel order: BGR
 </s> add         var_x = (var_x + 1.) / 2. * 255.  # channel order: BGR </s> remove         slices = slice(size // 2 - coverage // 2, size // 2 + coverage // 2)
 </s> add         slices = slice(size // 2 - coverage, size // 2 + coverage) </s> remove     var_x = y_pred - y_true
    loss = (K.abs(2.0-var_a)/var_a) * (K.pow(K.pow(var_x/cnst, 2.0)/K.abs(2.0-var_a) + 1.0,
                                             (var_a/2.0)) - 1.0)
    return K.mean(loss, axis=-1) * cnst
 </s> add     diff = y_pred - y_true
    second = (K.pow(K.pow(diff/beta, 2.) / K.abs(2.-alpha) + 1., (alpha/2.)) - 1.)
    loss = (K.abs(2.-alpha)/alpha) * second
    loss = K.mean(loss, axis=-1) * beta
    return loss </s> remove         coverage = self.get_coverage(image)
 </s> add         coverage = self.get_coverage(image) // 2 </s> remove def staircase_loss(y_true, y_pred, var_a=16.0, cnst=1.0/255.0):
    """ Keras Staircase Loss """
    height = cnst
    width = cnst
    var_x = K.clip(K.abs(y_true - y_pred) - 0.5 * cnst, 0.0, 1.0)
    loss = height*(K.tanh(var_a*((var_x/width)-tf.floor(var_x/width)-0.5)) /
                   (2.0*K.tanh(var_a/2.0)) + 0.5 + tf.floor(var_x/width))
    loss += 1e-10
    return K.mean(loss, axis=-1)
 </s> add def l_p_norm(y_true, y_pred, p_norm=np.inf):
    """
    Calculate the L-p norm as a loss function,
    valid choics of p are [0,1,no.inf]
    """
    diff = y_true - y_pred
    loss = tf.norm(diff, ord=p_norm, axis=-1)
    return loss


def l_inf_norm(y_true, y_pred):
    """ Calculate the L-inf norm as a loss function """
    diff = K.abs(y_true - y_pred)
    max_loss = K.max(diff, axis=(1, 2), keepdims=True)
    loss = K.mean(max_loss, axis=-1)
    return loss
        radius = round(max(1., mask_diameter * radius_ratio / 100.))
        kernel_size = radius * 2 + 1
  
      def get_kernel_size(self, radius_ratio):
          """ Set the kernel size to absolute """
          mask_diameter = np.sqrt(np.sum(self.mask))
        radius = round(max(1., mask_diameter * radius_ratio / 100.))
        kernel_size = radius * 2 + 1
        radius = round(max(1., mask_diameter * radius_ratio / 100.))
        kernel_size = radius * 2 + 1
          logger.trace("kernel_size: %s", kernel_size)
          return kernel_size
  
      @staticmethod
      def get_kernel_tuple(kernel_size):
keep keep keep keep replace replace keep keep keep keep keep
 documentation, pep8, style, clarity updates  - Prep for Segmentation (#812)

* documentation, pep8, style, clarity updates

* Update cli.py

* Update _config.py

remove extra mask and coverage

mask type as dropdown

* Update training_data.py

move coverage / LR to global
cut down on loss description

style change
losses working in PR

* simpler logging

* legacy update 
plugins/convert/mask/_base.py