import tensorflow as tf

        values=[tf.zeros((batch_size, 1)), tf.ones((batch_size, 1))], axis=0)

    grl = gradient_reverse(samples)
    grl = tf.reshape(grl, (-1, samples.get_shape().as_list()[1]))

    grl = fc(grl, 100, True, None, activation=relu, name='fc1')
    logits = fc(grl, 1, True, None, activation=None, name='fc2')

    domain_predictions = tf.sigmoid(logits)

  domain_loss = tf.losses.log_loss(domain_selection_mask, domain_predictions, weights=weight)

  domain_accuracy = util.accuracy_tf(domain_selection_mask, tf.round(domain_predictions))

  assert_op = tf.Assert(tf.is_finite(domain_loss), [domain_loss])
  with tf.control_dependencies([assert_op]):
