How to generate discrete sequence?

I am trying to use the simple GAN network from week 1 to generate a sequence with 4 discrete categories , such as 00001232231. I know GAN was not able to generate discrete data due to it’s not differentiable .

Hi @Anna_Ning

The GAN network form week1 is an introduction to the network components. This GAN network generates unconditional output, so it would not be able to meet your requirement. In week 4, the lectures will cover conditional GAN, giving you the techniques on how to generate your chosen output.

1 Like

Thanks so much ! I found a solution to my problem using Gumbel softmax so I can actually train discrete dataset using GAN end-to-end. So no it was able to modify the gradient directly .

Hi @Anna_Ning ,

Very good effort and well done for finding a method using GAN to generate discrete data. Would you like to share how you did it?

So I was reading on this paper where they used a Gumbel Softmax. Basically I do a one-hot encoding for each categorical value, then add gumbel softmax at the forward step where it introduce some random variable into the calculation so it’s differentiable.I only take argmax at evaluation step instead of training time. :smiley: