  
              coords = tf.cast(tf.range(size), sigma.dtype)
              coords -= tf.cast(size - 1, sigma.dtype) / 2.0
  
              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])
  
          def _ssim_helper(var_x, var_y, max_val, kernel, compensation=1.0):
              """
              Helper function for computing SSIM.
              SSIM estimates covariances with weighted sums.  The default parameters
 
</s> remove         def _ssim_helper(var_x, var_y, max_val, kernel, compensation=1.0):
 </s> add         def _ssim_helper(img1, img2, max_val, kernel, compensation=1.): </s> remove             """
            Function to mimic the 'fspecial' gaussian MATLAB function.
            """
 </s> add             """ Function to mimic the 'fspecial' gaussian MATLAB function. """
 </s> remove             num1 = reducer(var_x * var_y, kernel) * 2.0
            den1 = reducer(tf.square(var_x) + tf.square(var_y), kernel)
            c_2 *= compensation
            c_s = (num1 - num0 + c_2) / (den1 - den0 + c_2)
 </s> add             num1 = reducer(img1 * img2, kernel) * 2.0
            den1 = reducer(tf.square(img1) + tf.square(img2), kernel)
            c_s = (num1 - num0 + c_two) / (den1 - den0 + c_two) </s> remove             #   (2 * cov_{xy} + c_2) / (cov_{xx} + cov_{yy} + c_2).
 </s> add             #   (2 * cov_{xy} + c_two) / (cov_{xx} + cov_{yy} + c_two). </s> remove             luminance = (num0 + c_1) / (den0 + c_1)
 </s> add             luminance = (num0 + c_one) / (den0 + c_one)
            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])
  
              coords = tf.cast(tf.range(size), sigma.dtype)
              coords -= tf.cast(size - 1, sigma.dtype) / 2.0
  
            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])
            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])
            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])
            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])
            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])
            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])
            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])
  
          def _ssim_helper(var_x, var_y, max_val, kernel, compensation=1.0):
              """
              Helper function for computing SSIM.
              SSIM estimates covariances with weighted sums.  The default parameters
keep keep keep keep replace replace replace replace 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