          values. The shape is [..., channels].
          """
  
          def _fspecial_gauss(size, sigma):
              """
              Function to mimic the 'fspecial' gaussian MATLAB function.
              """
              size = tf.convert_to_tensor(size, 'int32')
              sigma = tf.convert_to_tensor(sigma)
  
              coords = tf.cast(tf.range(size), sigma.dtype)
              coords -= tf.cast(size - 1, sigma.dtype) / 2.0
 
</s> remove             var_g = tf.square(coords)
            var_g *= -0.5 / tf.square(sigma)

            var_g = tf.reshape(var_g, shape=[1, -1]) + tf.reshape(var_g, shape=[-1, 1])
            var_g = tf.reshape(var_g, shape=[1, -1])  # For tf.nn.softmax().
            var_g = tf.nn.softmax(var_g)
            return tf.reshape(var_g, shape=[size, size, 1, 1])
 </s> add             gauss = tf.square(coords)
            gauss *= -0.5 / tf.square(sigma)
            gauss = tf.reshape(gauss, shape=[1, -1]) + tf.reshape(gauss, shape=[-1, 1])
            gauss = tf.reshape(gauss, shape=[1, -1])  # For tf.nn.softmax().
            gauss = tf.nn.softmax(gauss)
            return tf.reshape(gauss, shape=[size, size, 1, 1]) </s> remove     true_edge_mag = scharr_edges(y_true, True)
    pred_edge_mag = scharr_edges(y_pred, True)
    cnst = 0.002
    upper = 2.0 * tf.multiply(true_edge_mag, pred_edge_mag) + cnst
    lower = tf.square(true_edge_mag) + tf.square(pred_edge_mag) + cnst
    gms = tf.div(upper, lower)
    _mean, _var = tf.nn.moments(gms, axes=[1, 2], keep_dims=True)
    # single metric value per image in tensor [?, 1, 1]
    gmsd = tf.reduce_mean(tf.sqrt(_var), axis=-1)
    # need to expand to [?, height, width] dimensions for Keras ... modify to not be hard-coded
    return K.tile(gmsd, [1, 64, 64])


def ms_ssim(img1, img2, max_val=1.0, power_factors=(0.0517, 0.3295, 0.3462, 0.2726)):
 </s> add     true_edge = scharr_edges(y_true, True)
    pred_edge = scharr_edges(y_pred, True)
    ephsilon = 0.0025
    upper = 2.0 * true_edge * pred_edge
    lower = K.square(true_edge) + K.square(pred_edge)
    gms = (upper + ephsilon) / (lower + ephsilon)
    gmsd = K.std(gms, axis=(1, 2, 3), keepdims=True)
    gmsd = K.squeeze(gmsd, axis=-1)
    return gmsd


def ms_ssim_calc(img1, img2, max_val=1.0, power_factors=(0.0517, 0.3295, 0.3462, 0.2726)): </s> remove         radius = max(1, round(mask_diameter * radius_ratio / 100))
        kernel_size = int((radius * 2) + 1)
 </s> add         radius = round(max(1., mask_diameter * radius_ratio / 100.))
        kernel_size = radius * 2 + 1 </s> remove         compensation = 1.0
 </s> add         compensation = 1. </s> remove             def reducer(var_x, kernel):
                shape = tf.shape(var_x)
                var_x = tf.reshape(var_x, shape=tf.concat([[-1], shape[-3:]], 0))
                var_y = tf.nn.depthwise_conv2d(var_x, kernel, strides=[1, 1, 1, 1], padding='VALID')
                return tf.reshape(var_y, tf.concat([shape[:-3], tf.shape(var_y)[1:]], 0))
 </s> add             def reducer(img1, kernel):
                shape = tf.shape(img1)
                img1 = tf.reshape(img1, shape=tf.concat([[-1], shape[-3:]], 0))
                img2 = tf.nn.depthwise_conv2d(img1, kernel, strides=[1, 1, 1, 1], padding='VALID')
                return tf.reshape(img2, tf.concat([shape[:-3], tf.shape(img2)[1:]], 0))
            """ Function to mimic the 'fspecial' gaussian MATLAB function. """

          values. The shape is [..., channels].
          """
  
          def _fspecial_gauss(size, sigma):
            """ Function to mimic the 'fspecial' gaussian MATLAB function. """

            """ Function to mimic the 'fspecial' gaussian MATLAB function. """

            """ Function to mimic the 'fspecial' gaussian MATLAB function. """

              size = tf.convert_to_tensor(size, 'int32')
              sigma = tf.convert_to_tensor(sigma)
  
              coords = tf.cast(tf.range(size), sigma.dtype)
              coords -= tf.cast(size - 1, sigma.dtype) / 2.0
keep keep keep keep replace 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 
lib/model/losses.py