MATLAB Answers


Matlab does not currently support Generative Adversarial Neural Networks

Asked by ashkan dashtban on 21 Apr 2018
Latest activity Commented on by Atallah Baydoun on 7 Nov 2019
I searched a lot to see if Matlab supports GAN but unfortunately it does not. I just found deconvolution layer. does anybody know how I can use that for designing a GAN. I am gonna integrate a GAN block within a DAG network and I am not sure if it is possible. I found also another open source lib 'MatConvNet'. is is possible to use it within DAG? Thank you very much I hope it is not wasting time working on deep learning with Matlab.
web address of matconvnet:
web address of DAG :


yes, you are right. but here I want to know how to fulfill GAN with official deep learning tool box of matlab but not matconvnet?
Generative Adversarial Neural Networks are not available in any Mathworks product. They are not supported by the Neural Network toolbox.
ashkan dashtban comments to me:
Exactly and we hopefuly expect it to be available in near future!

Sign in to comment.

3 Answers

Answer by Shounak Mitra on 6 Jun 2019

In the next release, we're going to provide some flexbilities to design advanced networks such as GANs, Siamese Networks etc. Hang on :)


  • we hope Matlab will provide more flexibility in new release to enable us to build hybrid dynamic networks by combining different components of neural networks. Also, If we could add customized metric funciotions, say precision instead of accuracy.! such capability makes MatLab much more powerfull and handy than python!
Great feedback. We're working on that too.

Sign in to comment.

Answer by KH TOHIDUL ISLAM on 19 Sep 2019

It is avilabel now, please check this out. Train Generative Adversarial Network (GAN)


Yep, It was the first thing I checked when I got the email about Matlab 2019 b.
How extensible is the current model to 3D ?

Sign in to comment.

Answer by Atallah Baydoun on 7 Jun 2019

Thanks Mitra for the info.
But when is the next release going to be ?


I am basically interested in DCGAN and cGAN. Will these types be supported ?
Let's think of it in terms of what important features you need to create GANs - autodifferentiation, custom training loops, and may be custom layers too (if you're curious!). All those things are planned to be supported. And of course, the deep learning layer support will be there.
Hopefully then Matlab will include an example on GAN generation also.

Sign in to comment.