import tensorflow as tf

    # 50*50
    # Step-wise contrastive loss
    even = [2 * i for i in range(25)]
    odd = [2 * i + 1 for i in range(25)]
    pred1 = tf.gather(pred, even)
    pred2 = tf.gather(pred, odd)
    tgt1 = tf.gather(tgt, even)
    tgt2 = tf.gather(tgt, odd)

    geq = tf.cast((tgt1 - tgt2) > 0, tf.bool)
    tgt_larg = tf.where(geq, tgt1, tgt2)
    tgt_small = tf.where(geq, tgt2, tgt1)
