import tensorflow as tf

    else:
      entropy = - targets * np.log(targets) - \
          (1. - targets) * np.log(1. - targets)
    return tf.nn.sigmoid_cross_entropy_with_logits(
        labels=tf.ones_like(logits) * targets, logits=logits) - entropy

  def _setup_model_loss(self, update_ops=None, num_classes=6):
    self.learning_rate_d = tf.placeholder(tf.float32, shape=[], name="learning_rate_placeholder")
    self.learning_rate_g = tf.placeholder(tf.float32, shape=[], name="learning_rate_placeholder")

    d_optimizer = self._optimizer(
        self.learning_rate_d,
        optname=self.cnf.get('optname', 'momentum'),
        **self.cnf.get('opt_kwargs', {'decay': 0.9}))
