Giter Club home page Giter Club logo

gan-tutorial's Introduction

GANs Tutorial

Very simple implementation of GANs, DCGANs, CGANs, WGANs, and etc. with PyTorch for various dataset (MNIST, CARS, CelebA).

You can run the code at Jupyter Notebook. And actually you can also run these codes by using Google Colab immediately (needed downloading some dataset)!

Sometimes ipynb files do not work in Github, please clone and run it in your server.

Requirements

  • python 3.6 (Anaconda)
  • pytorch 1.0.0 (updated from 0.4.0. If you want to use the previous version, then find previous commit.)

Implementation List

MNIST

CARS (Stanford dataset)

CelebA (aligned dataset)

Experimental Results

  • You can also see the samples at ipynbs.
  • After DCGAN, DCGAN with condition is a base model.
  • Trained 30 epochs respectively.

Vanilla GAN

Conditional GAN

DC GAN

WGAN-gp

infoGAN w/ walking code 1

infoGAN w/ walking code 2

BEGAN random samples (20 epochs)

BEGAN interpolation

GAN with R1 regularization random samples (20 epochs)

GAN with R1 regularization interpolation

Colab

gan-tutorial's People

Contributors

yangyangii 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

gan-tutorial's Issues

change size of image

Hi, thank you for making an amazing notebook that I can practice.

I would like to change the size of the image.

For example, in R1GAN and BEGAN, IMAGE_DIM is (64, 64, 3). However, I would like to change IMAGE_DIM as (512,512,3) .

I want my result of GAN also to become (512,512,3). Can you give me the instruction about how am I supposed to change the network?

Thank you

not an issue: what is the function of the 10 in get_sample_image(G, n_noise)

def get_sample_image(G, n_noise):
    """
        save sample 100 images
    """
    z = torch.randn(10, n_noise).to(DEVICE)
    y_hat = G(z).view(10, 3, 28, 28).permute(0, 2, 3, 1) # (100, 28, 28)
    result = (y_hat.detach().cpu().numpy()+1)/2.
    return result

What is the deal with the 10? I understand the 100 is random noise as an input, but what about the 10? Thank you so much for your repo btw, very helpful to me.

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.