GithubHelp home page GithubHelp logo

icaruswizard / deep-generative-models Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 248 KB

Collection of PyTorch implementation for several deep generative models.

License: MIT License

Python 100.00%

deep-generative-models's Introduction

Deep Generative Models

A collection of my PyTorch implementation of several deep generative models.
This repertory is in progressing, feel free to raise an issue if you find any bug.

Requirement

  • PyTorch >= 1.0 (This code was develop on 1.3.1, but it should also work fine on other version)
  • tensorboard (tb-nightly)
  • numpy, scipy (ndarry support)
  • matplotlib, moviepy (visualizing result)
  • tqdm (progress bar)

Setup

Recommend to setup with Anaconda

git clone https://github.com/IcarusWizard/Deep-Generative-Models
cd Deep-Generative-Models
pip install -e .

Models

Datasets

If you want to add new dataset, you need to define a creator function which returns three torch.utils.data.Dataset for training, validation, testing, and a dict holds the configuration of the dataset (c, h, w). Then you can add your custom loader through:

import degmo
def custom_creater():
  ......
  return training_set, validation_set, testing_set, config

degmo.add_dataset('name', custom_creater)

Code

Structure

logs/          # default tensorboard log folder
checkpoints/   # default checkpoints folder
degmo/         # main folder
  data/          # dataset functions
  config/        # default configurations
  utils.py       # shared utility functions
  modules.py     # shared utility modules
  <method>/
    trainer.py        # training procedure
    run_utils.py      # runtime utility functions
    utils.py          # method's utility functions
    modules.py        # method's utility modules
    <model.py>        # model class
    ......

Train

Run python -m degmo.train_<method> --dataset <dataset> --model <model> to train in default configuration. You can run python -m degmo.check_default_config <method> to find the default configuration we provide, or just look inside degmo/config folder.
If you want to tune some parameters for yourself, pass --custom to the training script, run python -m degmo.train_<method> -h to see all the parameters that you can tune.
Note: All the default configurations are tested on a single RTX 2080Ti GPU with 11G memory, if you cannot run some default configurations (i.e. Glow), please consider reduce the batch size or features in config file or with a custom mode.

During and after training, you can use tensorboard --logdir=logs to monitor progress.

Test

Run python -m degmo.test_<model> -h for help.

deep-generative-models's People

Contributors

icaruswizard avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

stevenjokess

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.