Texygen
Texygen copied to clipboard
Question of Generator Loss of MaliGAN
Is the generator loss of MaliGAN correct? It should be:
self.g_loss = -tf.reduce_sum(
tf.reduce_sum(
tf.one_hot(tf.to_int32(tf.reshape(self.x, [-1])), self.num_vocabulary, 1.0, 0.0) * tf.log(
tf.clip_by_value(tf.reshape(self.g_predictions, [-1, self.num_vocabulary]), 1e-20, 1.0)
), 1) * tf.reshape(self.rewards, [-1])
)