import tensorflow as tf

    return objectives, cstr_pct



def contra_step_lossV1(pred, tgt, temp=10.0):
    # Step-wise contrastive loss
    pred1, pred2 = tf.split(pred, 2, axis=0)
    tgt1, tgt2 = tf.split(tgt, 2, axis=0)
    soft_sign = tf.tanh((tgt1 - tgt2) * temp)
    loss = tf.maximum(0.0, soft_sign * ((tgt1 - tgt2) - (pred1 - pred2)))
    loss = tf.reduce_mean(loss)
    return loss


def contra_step_lossV2(pred, tgt):
    # Step-wise contrastive loss

    pred1, pred2 = tf.split(pred, 2, axis=0)
