I hope this is the right place to ask this, as I mostly see questions related to the GAN specialization.
I joined this specialization because I would like to create a GAN that can output strings of text, like a single word composed of alphanumeric and special characters.
I saw in the first course that there is ProteinGAN that can do that, but the code does not get into the training of the model because of the time it takes to train the GAN.
I have seen papers using the one-hot encoding to represent each character, and I’d like to have an opinion on that matter.
Hi, @Barb
Actually, if you want to generate texts, you need some knowledge about Sequence Model, especially for LSTM. These topics are covered in the last course of Deep Learning Specialization.
Specifically, there is exactly one Programming Assignment – Dinosaur Island - Character-Level Language Modeling – in it guiding you to generate dinosaur-name-like texts.
Hi @Barb,
With respect to your question, it is a long story to combine GANs and LSTM. The best practice is to definitely read some papers and learn from others’ open source implementations.
In this point, I think @RC_Stark has given all you need. Thanks for your detailed list, @RC_Stark. ;D
@RC_Stark agreed, so far I’ve always found that looking at other people’s implementation to be quite stressful because of the size of the code.
@kevinjiang Thanks, I was just asking because in the GAN spec. it has been pointed out that you can use GANs component to acts as VAE etc, so I thought that some combination might be doable.
In any case, I’ll try to build my own GAN progressively and then change components like a mechanic.
Thank you all for the reading suggestions and the github, this is much appreciated.
the goal is not simply to duplicate what has already been done by someone else. the primary goal is to understand the mechanisms behind each mechanism and understand the why and the how in order to be able to better know when in an open source code I can integrate an element of someone else’s code and adapt it to their own needs
very good sources have been given to you, keep learning
Generating text using GAN is an interesting topic.
As @kevinjiang mentioned, you can use Sequence models to generate text, like GPT, BERT, XLNet and more.
For generating text using GAN, apart from the papers @RC_Stark mentioned, you can have a look at PassGAN as well, it is creating a variant of GAN and use it to crack passwords, which is strings of characters, symbols and numbers.
Here is their paper and opensource code.
You raised an interesting question. GANs are primarily used as generative models, but the attention mechanism of GAN is still an active area of research. For text generation, we need the insight/output from previous layers of the neural network. In such cases, Sequence and Attention models work best. You can look out for attention models such as BERT/ T5/ GPT and so on; yet you can try to use GAN for text generation where the sequence and attention mechanism might become handy.
@fangyiyu Thanks for the input, I think PassGAN is the closest to my topic, I’ll have a look. @albirahman I see, I’ve seen BERT and GPT, but I have to emphasize that what I need is not a NLP Generator, but a geneator that can output a single string based on training etc.
I’ll also investigate LTSM networks, they seem to be a potential match.
Edit: When I mean single string, I mean in the way that it does not carry a linguistic meaning.
Small update on my understanding, if anyone can confirm:
Each discrete character is onehot encoded and each onehot is concatenated to make a tensor.
Then when the generator produces a fake, an argmax function is applied for each “character” of the output because the generator will not nicely produce a onehot-like output.