import tensorflow as tf

      self._add_loss_summary('loss_total', self.loss_total)
    self.summs_train = tf.summary.merge_all('train')
    # reconstructions
    with tf.name_scope('decodings'):
      self.image_summaries = {
        'orig': self._add_decoding_summary('0_original_input', self.input),
        'reco': self._add_decoding_summary('1_reconstruction', self.eval_decode),
        'pred': self._add_decoding_summary('2_prediction', self.eval_decode),
        'midd': self._add_decoding_summary('3_averaged', self.eval_decode),
        'nois': self._add_decoding_summary('4_noisy', self.eval_decode)
      }
    # visualization
    fig = vis.get_figure()
    fig.canvas.draw()
    self.vis_placeholder = tf.placeholder(tf.uint8,  ut.fig2rgb_array(fig).shape)
    self.vis_summary = tf.summary.image('visualization', self.vis_placeholder)
    # embedding
    dists = l2(self.embedding_test[:-1] - self.embedding_test[1:])
    self.dist = dists
    metrics = []

    metrics.append(tf.summary.histogram('point_distance', dists))
    metrics.append(tf.summary.scalar('training/trajectory_length', tf.reduce_sum(dists)))
    self.blur_ph = tf.placeholder(dtype=tf.float32)
    metrics.append(tf.summary.scalar('training/blur_sigma', self.blur_ph))

    pred = self.embedding_test[1:-1]*2 - self.embedding_test[0:-2]
    pred_error = l2(pred - self.embedding_test[2:])

    mean_dist, mean_pred_error = tf.reduce_mean(dists), tf.reduce_mean(pred_error)
