Texygen icon indicating copy to clipboard operation
Texygen copied to clipboard

Question of Generator Loss of MaliGAN

Open cyk1337 opened this issue 3 years ago • 0 comments

Is the generator loss of MaliGAN correct? It should be:

image

https://github.com/geek-ai/Texygen/blob/3104e22ac75f3cc2070da2bf5e2da6d2bef149ad/models/maligan_basic/MaliganGenerator.py#L112

        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])
        )

cyk1337 avatar Aug 24 '20 07:08 cyk1337