Message Boards Message Boards

Implement a GAN (generative adversarial network)?

Posted 6 years ago

Hello everyone,

I am trying to code a generative adversarial network using Mathematica's neural networks but I have a few questions still.

  1. Since I am no computer scientist (yet) I intend on taking the structure of a GAN and implementing it into Mathematica. However I have trouble finding Fractionally-Strided Convolution layers. Is that the same as Deconvolution layers in Mathematica or should I use some other layers ?

  2. Is there a specific encoder for text ? Since my input will be a piece of text describing the output image, a built in encoder might help greatly.

  3. And finally, since GANs are composed of a generator and a discriminator battling each other, how do I, in Mathematica, implement this back and forth battle between the two nets ?

I really am a beginner in using neural networks so any help is greatly appreciated. Because of that, I am fully aware that entire swathes of computer science might have to been explained to me, however a quick direction towards the important topics can help me direct my research. Thank you for your answers !

POSTED BY: Luca Montanelli
2 Replies

Hello Luca,

A1: yes, it's the same

A2: yes again

Characters encoder: http://reference.wolfram.com/language/ref/netencoder/Characters.html

Words (tokens) encoder: http://reference.wolfram.com/language/ref/netencoder/Tokens.html

If you need an additional text preprocessing (delete stopwords, reduce words to their stems etc), you can find useful functions here: http://reference.wolfram.com/language/guide/ProcessingTextualData.html

And don't forget about EmbeddingLayer and UnitVectorLayer. One of them should be the first layer in your network when you work with text (choice of the layer depends of your architecture). Examples in attachment.

A3: https://mathematica.stackexchange.com/questions/140294/generative-adversarial-network/

Alexey

Attachments:
POSTED BY: Alexey Golyshev

I'm sorry for the very late reply, I forgot a bit and am only coming back to it now. Thank you very much for your answer ! I had already seen the link to the stackexchange question and their notebooks did not work for me. I'll be sure to check the reason why and look into the other things you linked aswell. Again, thank you !

POSTED BY: Luca Montanelli
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract