import tensorflow as tf

    with tf.control_dependencies(assertions):
      product = tf.multiply(predictions, labels)
    internal_dot_products = tf.reduce_sum(product, [1])
    logcost = tf.log(1e-4 + 1 - tf.abs(internal_dot_products))
  return logcost

