import tensorflow as tf


    # build regularized distance objective
    dist_loss1 = self._distance_loss(models[1].encode - models[0].encode)
    dist_loss2 = self._distance_loss(models[1].encode - models[2].encode)

    # Stitch it all together and train
    self.loss_reco = tf.add_n(reco_losses)
    self.loss_pred = pred_loss_0 + pred_loss_2
    self.loss_dist = dist_loss1 + dist_loss2
    self.losses = [self.loss_reco, self.loss_pred]

  def _distance_loss(self, distances):
