              den0 = tf.square(mean0) + tf.square(mean1)
              luminance = (num0 + c_1) / (den0 + c_1)
  
              # SSIM contrast-structure measure is
              #   (2 * cov_{xy} + c_2) / (cov_{xx} + cov_{yy} + c_2).
              # Note that `reducer` is a weighted sum with weight w_k, \sum_i w_i = 1, then
              #   cov_{xy} = \sum_i w_i (x_i - \mu_x) (y_i - \mu_y)
              #          = \sum_i w_i x_i y_i - (\sum_i w_i x_i) (\sum_j w_j y_j).
              num1 = reducer(var_x * var_y, kernel) * 2.0
              den1 = reducer(tf.square(var_x) + tf.square(var_y), kernel)
 
</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             luminance = (num0 + c_1) / (den0 + c_1)
 </s> add             luminance = (num0 + c_one) / (den0 + c_one) </s> remove             # (2 * mu_x * mu_y + c_1) / (mu_x ** 2 + mu_y ** 2 + c_1).
            mean0 = reducer(var_x, kernel)
            mean1 = reducer(var_y, kernel)
            num0 = mean0 * mean1 * 2.0
 </s> add             # (2 * mu_x * mu_y + c_one) / (mu_x ** 2 + mu_y ** 2 + c_one).
            mean0 = reducer(img1, kernel)
            mean1 = reducer(img2, kernel)
            num0 = mean0 * mean1 * 2. </s> remove             _ssim_k1 = 0.01
            _ssim_k2 = 0.03

            c_1 = (_ssim_k1 * max_val) ** 2
            c_2 = (_ssim_k2 * max_val) ** 2
 </s> add             c_one = (0.01 * max_val) ** 2
            c_two = ((0.03 * max_val)) ** 2 * compensation </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])
            #   (2 * cov_{xy} + c_two) / (cov_{xx} + cov_{yy} + c_two).
              den0 = tf.square(mean0) + tf.square(mean1)
              luminance = (num0 + c_1) / (den0 + c_1)
  
              # SSIM contrast-structure measure is
            #   (2 * cov_{xy} + c_two) / (cov_{xx} + cov_{yy} + c_two).
              # Note that `reducer` is a weighted sum with weight w_k, \sum_i w_i = 1, then
              #   cov_{xy} = \sum_i w_i (x_i - \mu_x) (y_i - \mu_y)
              #          = \sum_i w_i x_i y_i - (\sum_i w_i x_i) (\sum_j w_j y_j).
              num1 = reducer(var_x * var_y, kernel) * 2.0
              den1 = reducer(tf.square(var_x) + tf.square(var_y), kernel)
keep keep keep keep 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