  
                  remainder = tails[0] % divisor_tensor
                  need_padding = tf.reduce_any(tf.not_equal(remainder, 0))
                  padded = tf.cond(need_padding,
                                   lambda: do_pad(flat_imgs, remainder),
                                   lambda: flat_imgs)
  
                  downscaled = [tf.nn.avg_pool(x, ksize=divisor, strides=divisor, padding='VALID')
                                for x in padded]
                  tails = [x[1:] for x in tf.shape_n(downscaled)]
                  imgs = [tf.reshape(x, tf.concat([h, t], 0))
 
</s> remove                 downscaled = [tf.nn.avg_pool(x, ksize=divisor, strides=divisor, padding='VALID')
                              for x in padded]
 </s> add                 downscaled = [tf.nn.avg_pool(x,
                                             ksize=divisor,
                                             strides=divisor,
                                             padding='VALID') for x in padded] </s> remove                 flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0))
                             for x, t in zip(imgs, tails)]

 </s> add                 zipped = zip(imgs, tails)
                flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0)) for x, t in zipped] </s> remove                 imgs = [tf.reshape(x, tf.concat([h, t], 0))
                        for x, h, t in zip(downscaled, heads, tails)]
 </s> add                 zipper = zip(downscaled, heads, tails)
                imgs = [tf.reshape(x, tf.concat([h, t], 0)) for x, h, t in zipper] </s> remove                 # Overwrite previous ssim value since we only need the last one.
                ssim_per_channel, c_s = _ssim_per_channel(*imgs, max_val=max_val)
                mc_s.append(tf.nn.relu(c_s))
 </s> add             # Overwrite previous ssim value since we only need the last one.
            ssim_per_channel, c_s = _ssim_per_channel(*imgs, max_val=max_val)
            mc_s.append(tf.nn.relu(c_s)) </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))
                                 lambda: do_pad(flat_imgs, remainder), lambda: flat_imgs)
  
                  remainder = tails[0] % divisor_tensor
                  need_padding = tf.reduce_any(tf.not_equal(remainder, 0))
                  padded = tf.cond(need_padding,
                                 lambda: do_pad(flat_imgs, remainder), lambda: flat_imgs)
                                 lambda: do_pad(flat_imgs, remainder), lambda: flat_imgs)
  
                  downscaled = [tf.nn.avg_pool(x, ksize=divisor, strides=divisor, padding='VALID')
                                for x in padded]
                  tails = [x[1:] for x in tf.shape_n(downscaled)]
                  imgs = [tf.reshape(x, tf.concat([h, t], 0))
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 
lib/model/losses.py