def xent_loss(teacher_logits, student_logits, labels, distill_tempreture, task_balance):
    student_task_xent = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=tf.squeeze(labels), logits=student_logits))
    teacher_targets = tf.nn.softmax((teacher_logits / distill_tempreture))
    student_distill_xent = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=tf.stop_gradient(teacher_targets), logits=student_logits))
    losses = (task_balance * student_task_xent)
    losses += ((1 - task_balance) * student_distill_xent)
    return losses
def xent_loss(teacher_logits, student_logits, labels, distill_tempreture, task_balance):
    student_task_xent = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=tf.squeeze(labels), logits=student_logits))
    teacher_targets = tf.nn.softmax((teacher_logits / distill_tempreture))
    student_distill_xent = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=tf.stop_gradient(teacher_targets), logits=student_logits))
    losses = (task_balance * student_task_xent)
    losses += ((1 - task_balance) * student_distill_xent)
    return losses