Coder Social home page Coder Social logo

dongjunlee / gan-pytorch Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 497 KB

PyTorch implementation of 'GAN (Generative Adversarial Networks)'

Python 100.00%
pytorch generative-adversarial-network gan estimator hb-experiment deep-learning experiments generative-model

gan-pytorch's Introduction

Generative Adversarial Nets hb-research

PyTorch implementation of Generative Adversarial Nets.

images

Requirements

Project Structure

.
├── config                  # Config files (.yml, .json) using with hb-config
├── gan                     # Generative Adversarial Networks architecture 
    ├── __init__.py             # train, evaluate, predict logic
    ├── module.py               # Discriminator, Generator module
    └── utils.py                # Save and Load Model, TensorBoard
├── data_loader.py          # make_data_loader (using DataLoader)
├── main.py                 
├── model.py                # define Model Spec
└── model.py                # utils

Reference : hb-config

Config

Can control all Experimental environment.

example: config.yml

data:
  path: "data/"

model:
  z_dim: 100     # Random noise dimension coming into generator, per output vector
  real_dim: 784

  g_h1: 256
  g_h2: 512
  g_h3: 1024

  d_h1: 1024
  d_h2: 512
  d_h3: 256

  dropout: 0.3

train:
  model_dir: "logs/gan"
  batch_size: 64
  train_steps: 50000

  d_learning_rate: 0.0002  # 2e-4
  g_learning_rate: 0.0002
  optim_betas:
    - 0.9
    - 0.999

  save_checkpoints_steps: 1000
  verbose_step_count: 100

predict:
  batch_size: 64

slack:
  webhook_url: ""  # after training notify you using slack-webhook

Usage

Install requirements.

pip install -r requirements.txt

Then, start training

python main.py --mode train

After training, generate images

python main.py --mode predict

  • generated image example

images

Experiments modes

✅ : Working
◽ : Not tested yet.

  • evaluate : Evaluate on the evaluation data.
  • train : Fit the estimator using the training data.
  • train_and_evaluate : Interleaves training and evaluation.
  • predict : Generate images.

Tensorboar

tensorboard --logdir logs

  • example

images

Reference

Author

Dongjun Lee ([email protected])

gan-pytorch's People

Contributors

dongjunlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.