import tensorflow as tf

    self.end_points_D_val = self.model.discriminator(
        inputs, False, True, num_classes=num_classes, batch_size=batch_size_val)

    # For printing layers shape
    self.training_end_points = self.end_points_D
    self.training_end_points.update(self.end_points_G)

    tf.summary.histogram("d", self.end_points_D['D_on_data'])
    tf.summary.histogram("d_", self.end_points_D['D_on_G'])
    tf.summary.image("G", G)

    d_label_smooth = self.cnf['d_label_smooth']  # 0.25
    self.d_loss_real = self._sigmoid_kl_with_logits(self.end_points_D['D_on_data_logits'],
                                                    1. - d_label_smooth)
    class_loss_weight = 1.
    self.d_loss_class = class_loss_weight * tf.nn.sparse_softmax_cross_entropy_with_logits(
        logits=self.end_points_D['class_logits'], labels=tf.to_int64(targets))
    self.test_loss = 1. - \
