import tensorflow as tf

    # 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)
    improvement = (mean_dist-mean_pred_error)/mean_dist
