code: def interpolate_loss(labels, loss1, loss2, interpolation_values):
      
      with tf.variable_scope("interpolate_focus_loss"):
          # Select the probs or weights with the labels.
          t = tf.reduce_sum(labels * interpolation_values, axis=-1)
          return (1 - t) * loss1 + t * loss2
docs: Interpolate two losses linearly.
  
      :param labels: A float tensor of shape [batch_size, ..., num_classes] representing the label class probabilities.
      :param loss1: A float tensor of shape [batch_size, ...] representing the loss1 for interpolation.
      :param loss2: A float tensor of shape [batch_size, ...] representing the loss2 for interpolation.
      :param interpolation_values: The values for each class how much focal loss should be interpolated in.
      :return: A tensor representing the weighted cross entropy.