MATLAB Answers

how to fulfill GAN (Generative Adversarial Networks ) or DCGAN in matlab?

조회 수: 207(최근 30일)
I find that there is no example demo for GAN (Generative Adversarial Networks ) or DCGAN. I wonder how to fulfill GAN in matlab? if for GAN, is the last output of the generator RegressionOutputLayer or others?

채택된 답변

Muhammad Usama Sharaf SAAFI
편집: Muhammad Usama Sharaf SAAFI 7 Jan 2020
Only MATLAB 2019b has demo example of GAN.Example code also works on GPU but you should have CUDA 10.1 driver installed in your system However you can also look below link if you donot have Matlab 2019b.

  댓글 수: 0

로그인 to comment.

추가 답변(6개)

Walter Roberson
Walter Roberson 13 Jul 2018
Generative Adversarial Neural Networks are not available in any Mathworks product. They are not supported by the Neural Network toolbox.

  댓글 수: 2

Jack Xiao
Jack Xiao 13 Jul 2018
what a pity! looking forward to the supporting!
Jony Castagna
Jony Castagna 27 Sep 2019
Just looked at version 2019b: they support GANs now!

로그인 to comment.


mohammed mahmoud
mohammed mahmoud 29 Jul 2018
View this link dcgan-matconvnet

  댓글 수: 0

로그인 to comment.


azad
azad 17 Sep 2018
still no GAN support !

  댓글 수: 1

Jack Xiao
Jack Xiao 13 Jan 2019
Yes, so sad... hope coming soon...

로그인 to comment.


Niklas
Niklas 7 Jul 2019
In our team we realize GANs with regression layers as output layer. Works fine in our cases.
You also have the possibility to define own layers: See this doc https://de.mathworks.com/help/deeplearning/ug/define-custom-deep-learning-layers.html for further Informations.
Best wishes, Niklas

  댓글 수: 2

Jack Xiao
Jack Xiao 8 Jul 2019
thank you, i wonder how do you train discriminator as there are still no demos for training multiple nets simultaneously at present?
can you release your project or any detailed information?
Niklas
Niklas 8 Jul 2019
Unfortunately I can not upload the code.
We use a RBM for our generator model. This we pretrain with own code but this part is very similar to the code snippets from Geoffrey Hinton. We also train a CNN for the descriminator part before we stick both models together. So after pretraining the CNN is very good in decisions whether an image is generated or a real one.
Afterwards we use some tricks. First we created a custom layer for the input where we are able to insert the seed for the generator and a real image. We pass the real image around the RBM. (Please note that you need a custom Sigmoid Activation Layer for RBMs). Afterwards we use custom layers in the CNN to identify both images simultaneously with the same weights as from the pretraining. You can just copy the Matlab Layers for that and modify them a bit. Finally we created an output layer for this custom CNN. There we track the differences between both classification probabilities. Note that you have to think about a correct Loss Function there. We train the whole model by inserting real images with different random seeds and a final result of 0 difference between both classifications.
Just a note on "easyness". We only do that because we need MATLAB Code at the end to export them on our embedded systems. If you just want to discover what GANs can do, you should for now stick to TensorFlow as its much easier. They have a good example on their website. But maybe Mathworks add native support for GANs in a future release?!

로그인 to comment.


Jony Castagna
Jony Castagna 27 Sep 2019
편집: Jony Castagna 27 Sep 2019
Just looked at version 2019b: they support GANs now! If only the Matlab base + NN toolbox was free...

  댓글 수: 1

Walter Roberson
Walter Roberson 13 Apr 2020
If only food and rent and property taxes were all free so that Mathworks employees didn't need to be paid... ?

로그인 to comment.


Yui Chun Leung
Yui Chun Leung 4 Apr 2020
I implemented different types of GANs with Matlab, including DCGAN, CycleGAN and more.
You can find my files in FileExchange or Github (https://github.com/zcemycl/Matlab-GAN).

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by