          closest_hashes = self._nearest_landmarks.get(filename)
          if not closest_hashes:
              dst_points_items = list(landmarks.items())
              dst_points = list(x[1] for x in dst_points_items)
              closest = (np.mean(np.square(src_points - dst_points),
                                 axis=(1, 2))).argsort()[:10]
              closest_hashes = tuple(dst_points_items[i][0] for i in closest)
              self._nearest_landmarks[filename] = closest_hashes
          dst_points = landmarks[choice(closest_hashes)]
          logger.trace("Returning: (dst_points: %s)", dst_points)
          return dst_points
 
</s> remove             ksize = int(ksize * self.multipass_factor)
 </s> add             ksize = round(ksize * self.multipass_factor) </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                                  lambda: do_pad(flat_imgs, remainder),
                                 lambda: flat_imgs)
 </s> add                                  lambda: do_pad(flat_imgs, remainder), lambda: flat_imgs) </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 
        if self.config.get("dssim_loss", False):
            if not predict and side.lower() == "a":
                logger.verbose("Using DSSIM Loss")
            loss_func = DSSIMObjective()
        else:
            loss_func = losses.mean_absolute_error
            if not predict and side.lower() == "a":
                logger.verbose("Using Mean Absolute Error Loss")
 </s> add         loss_dict = {'mae':                     losses.mean_absolute_error,
                     'mse':                     losses.mean_squared_error,
                     'logcosh':                 losses.logcosh,
                     'smooth_l1':               generalized_loss,
                     'l_inf_norm':              l_inf_norm,
                     'ssim':                    DSSIMObjective(),
                     'gmsd':                    gmsd_loss,
                     'pixel_gradient_diff':     gradient_loss}
        img_loss_config = self.config.get("loss_function", "mae")
        mask_loss_config = "mse"
            closest = (np.mean(np.square(src_points - dst_points), axis=(1, 2))).argsort()[:10]
          closest_hashes = self._nearest_landmarks.get(filename)
          if not closest_hashes:
              dst_points_items = list(landmarks.items())
              dst_points = list(x[1] for x in dst_points_items)
            closest = (np.mean(np.square(src_points - dst_points), axis=(1, 2))).argsort()[:10]
            closest = (np.mean(np.square(src_points - dst_points), axis=(1, 2))).argsort()[:10]
              closest_hashes = tuple(dst_points_items[i][0] for i in closest)
              self._nearest_landmarks[filename] = closest_hashes
          dst_points = landmarks[choice(closest_hashes)]
          logger.trace("Returning: (dst_points: %s)", dst_points)
          return dst_points
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/training_data.py