Code Monkey home page Code Monkey logo

glow-pytorch's Introduction

Glow

This is pytorch implementation of paper "Glow: Generative Flow with Invertible 1x1 Convolutions". Most modules are adapted from the offical TensorFlow version openai/glow.

TODO

  • Glow model. The model is coded as described in original paper, some functions are adapted from offical TF version. Most modules are tested.
  • Trainer, builder and hparams loaded from json.
  • Infer after training
  • Test LU_decomposed 1x1 conv2d

Scripts

  • Train a model with
    train.py <hparams> <dataset> <dataset_root>
    
  • Generate z_delta and manipulate attributes with
    infer_celeba.py <hparams> <dataset_root> <z_dir>
    

Training result

Currently, I trained model for 45,000 batches with hparams/celeba.json using CelebA dataset. In short, I trained with follwing parameters

HParam Value
image_shape (64, 64, 3)
hidden_channels 512
K 32
L 3
flow_permutation invertible 1x1 conv
flow_coupling affine
batch_size 12 on each GPU, with 4 GPUs
learn_top false
y_condition false

Reconstruction

Following are some samples at training phase. Row 1: reconstructed, Row 2: original.

Manipulate attribute

Use the method decribed in paper to calculate z_pos and z_neg for a given attribute. And z_delta = z_pos - z_neg is the direction to manipulate the original image.

  • manipulate Smiling (from negative to positive):

  • manipulate Young (from negative to positive):

  • manipulate Pale_Skin (from negative to positive):

  • manipulate Male (from negative to positive):

Issues

There might be some errors in my codes. Please help me to figure out.

glow-pytorch's People

Contributors

chaiyujin avatar

Watchers

James Cloos 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.