Code Monkey home page Code Monkey logo

matlab-gan's Introduction

Matlab-GAN License: MIT View Matlab-GAN on File Exchange Hits

Collection of MATLAB implementations of Generative Adversarial Networks (GANs) suggested in research papers. This repository is greatly inspired by eriklindernoren's repositories Keras-GAN and PyTorch-GAN, and contains codes to investigate different architectures of GAN models.

Configuration

To run the following codes, users should have the following packages,

  • MATLAB 2019b
  • Deep Learning Toolbox
  • Parallel Computing Toolbox (optional for GPU usage)

Datasets

Table of Contents

Outputs

GAN
-Generator, Discriminator
LSGAN
-Least Squares Loss
DCGAN
-Deep Convolutional Layer
CGAN
-Condition Embedding
ACGAN
-Classification
InfoGAN mnist
-Continuous, Discrete Codes
AAE
-Encoder, Decoder, Discriminator
Pix2Pix
-Pair and Segments checking
-Decovolution and Skip Connections
WGAN SGAN CycleGAN
-Instance Normalization
-Mutli-agent Learning
InfoGAN CelebA

References

  • Y. LeCun and C. Cortes, “MNIST handwritten digitdatabase,” 2010. [MNIST]
  • J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, andL. Fei-Fei, “ImageNet: A Large-Scale Hierarchical Image Database,” inCVPR09, 2009. [Apple2Orange (ImageNet)]
  • R. Tyleček and R. Šára, “Spatial pattern templates forrecognition of objects with regular structure,” inProc.GCPR, (Saarbrucken, Germany), 2013. [Facade]
  • Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learn-ing face attributes in the wild,” inProceedings of In-ternational Conference on Computer Vision (ICCV),December 2015. [CelebA]
  • Goodfellow, Ian J. et al. “Generative Adversarial Networks.” ArXiv abs/1406.2661 (2014): n. pag. (GAN)
  • Radford, Alec et al. “Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks.” CoRR abs/1511.06434 (2015): n. pag. (DCGAN)
  • Denton, Emily L. et al. “Semi-Supervised Learning with Context-Conditional Generative Adversarial Networks.” ArXiv abs/1611.06430 (2017): n. pag. (CGAN)
  • Odena, Augustus et al. “Conditional Image Synthesis with Auxiliary Classifier GANs.” ICML (2016). (ACGAN)
  • Chen, Xi et al. “InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets.” NIPS (2016). (InfoGAN)
  • Makhzani, Alireza et al. “Adversarial Autoencoders.” ArXiv abs/1511.05644 (2015): n. pag. (AAE)
  • Isola, Phillip et al. “Image-to-Image Translation with Conditional Adversarial Networks.” 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (2016): 5967-5976. (Pix2Pix)
  • J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros, “Unpairedimage-to-image translation using cycle-consistent ad-versarial networks,” 2017. (CycleGAN)
  • Arjovsky, Martín et al. “Wasserstein GAN.” ArXiv abs/1701.07875 (2017): n. pag. (WGAN)
  • Odena, Augustus. “Semi-Supervised Learning with Generative Adversarial Networks.” ArXiv abs/1606.01583 (2016): n. pag. (SGAN)

matlab-gan's People

Contributors

zcemycl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

matlab-gan's Issues

Testing code for cycleGAN

I have trained cycleGAN for dehazing the fog but I don't know how to test and predict the images. I am trying to test the images which is given in the below link:
https://www.mathworks.com/help/deeplearning/ug/unsupervised-medical-image-denoising-using-cyclegan.html
It would be great if you provide me the code for testing the GAN.
If I am trying to predict I am getting the following error
Error using predict (line 85)
No valid system or dataset was specified.

Error in testing (line 59)
generatedImageHD = predict(GradGBA,imageTestLD);

GradGBA is the weights obtained after training cycleGAN

kindly help me !!!!!!

negate the GPU Usage?

hey @zcemycl could you tell me what I should do to use only my laptop I don't have GPU so what should I do . is there a way to run the code just for testing purposes on my laptop . Like some code to negate the GPU Usage?

Originally posted by @hurmaeht in #11 (comment)

The error of code of LoadFacadeDatabase.mlx

I run the code(LoadFacadeDatabase.mlx)on the Matlab, and prompted for an error that he index exceeds the number of elements in the array .And LatCode.mat and ImgLib.mat were not found.

Pix2Pix implementation: Bug in the Generator?

First of all, thanks for the codes.

I think that the upsampling part of the Generator of the Pix2Pix code has a couple of issues. The order of the batchnorm and relu are permuted, and the u1 layer has no relu layer defined.
I have tested it with the "right" order and it works much better. Here is the code (with the changes in bold):

u1=dltranspconv(d7,params.TCW1,params.TCb1,'Stride',2,'Cropping','same');
u1=batchnormwrap(u1,params,st,7);
u1=relu(u1);
u1=cat(3,u1,d6);

exstattran = 'u%d = dltranspconv(u%d,params.TCW%d,params.TCb%d,"Stride",2,"Cropping","same");';
exstatrelu = 'u%d = relu(u%d);';
exstatbatch2='[u%d,st] = batchnormwrap(u%d,params,st,%d);';
exstatcat = 'u%d=cat(3,u%d,d%d);';
for i = 2:7
eval(sprintf(exstattran,i,i-1,i,i));
if i ~= 7
eval(sprintf(exstatbatch2,i,i,6+i));
eval(sprintf(exstatrelu,i,i));

eval(sprintf(exstatcat,i,i,7-i));
end
end
dly = tanh(u7);
end

CGAN Minst Dataset

Hello, I wanted to ask how I can format my own dataset to be like the MINST dataset for MATLAB. I want to use the CGAN for my own dataset of coin images but I don't know how to format those images to work with this code. could you please help?

How to save a model.

Hello.
Thanks for these nice codes.
Normally we do have checkpoints and model to save to a file.

  1. I want to know how to save the model.
    Is it good to save the paramGen and paramDis? and if it is then how to use as a model.
    2 .And also I want to know how to test pix2pix.m to a specific image file.
    Thanks in advance.

Retraining Encoder/Generator in AAE

Hello,

Iam currently implementing an AAE and found your great work!
However, is it possible that you forgot to add the part where the Encoder/Generator is retrained? Currently the Encoder/Generator weights are only updated once with the reconstruction error from the Encoder-Decoder Part.

Dont have GPU

image

Hello, I wanted to use the CycleGAN but it keeps saying that the CUDA Driver is unable to load and that the GPU Driver needs to be updated or reinstalled. I checked my laptop's GPU and it is Intel(R) UHD Graphics 620. I am slightly confused as to how to make it work if I don't have nvcuda.dll installed. I even tried installing nvcuda.dll but that also didn't seem to work. Please help me out here. How do I make this work if I don't have a GPU. or how to install a GPU on my computer to make this work.

batching indexing missing is some gans

First, thank you. This is an impressive collection of work you are sharing.

Some of the GANS seem to be missing batch indexing.

Should they have

idx = (i-1)*settings.batch_size+1:i*settings.batch_size;
ABatch=gpdl(trainAshuffle(:,:,:,idx),'SSCB');
BBatch=gpdl(trainBshuffle(:,:,:,idx),'SSCB');

rather than just

ABatch=gpdl(trainAshuffle(:,:,:,i),'SSCB');
BBatch=gpdl(trainBshuffle(:,:,:,i),'SSCB');

?

Latent_fake AAE

Hello again,

in line 108-110 of your AAE.m file the latent space is build by:

latent_fake = dly(1:settings.latent_dim,:)+...
    dly(settings.latent_dim+1:2*settings.latent_dim)*...
    randn(settings.latent_dim,settings.batch_size);

You are only taking the first pair of standard deviations (109) and multiplicate it with all samples from the standard gaussian (110). This results into a 1 x batch_size vector instead of a latent_dim x batch_size matrix. This vector is then added to the matrix of means (line 108). I think the correct way is:

latent_fake = dly(1:settings.latent_dim,:)+...
    dly(settings.latent_dim+1:2*settings.latent_dim,:) .*...
    randn(settings.latent_dim,settings.batch_size);

Greetings
Nico

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.