All Projects → hongyehu → RG-Flow

hongyehu / RG-Flow

Licence: MIT License
This is project page for the paper "RG-Flow: a hierarchical and explainable flow model based on renormalization group and sparse prior". Paper link: https://arxiv.org/abs/2010.00029

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to RG-Flow

Vae vampprior
Code for the paper "VAE with a VampPrior", J.M. Tomczak & M. Welling
Stars: ✭ 173 (+198.28%)
Mutual labels:  generative-model, representation-learning
srVAE
VAE with RealNVP prior and Super-Resolution VAE in PyTorch. Code release for https://arxiv.org/abs/2006.05218.
Stars: ✭ 56 (-3.45%)
Mutual labels:  generative-model, representation-learning
Variational Ladder Autoencoder
Implementation of VLAE
Stars: ✭ 196 (+237.93%)
Mutual labels:  generative-model, representation-learning
Awesome Vaes
A curated list of awesome work on VAEs, disentanglement, representation learning, and generative models.
Stars: ✭ 418 (+620.69%)
Mutual labels:  generative-model, representation-learning
ShapeFormer
Official repository for the ShapeFormer Project
Stars: ✭ 97 (+67.24%)
Mutual labels:  generative-model, representation-learning
Generalized-PixelVAE
PixelVAE with or without regularization
Stars: ✭ 64 (+10.34%)
Mutual labels:  generative-model
TriangleGAN
TriangleGAN, ACM MM 2019.
Stars: ✭ 28 (-51.72%)
Mutual labels:  generative-model
gan tensorflow
Automatic feature engineering using Generative Adversarial Networks using TensorFlow.
Stars: ✭ 48 (-17.24%)
Mutual labels:  representation-learning
cpnet
Learning Video Representations from Correspondence Proposals (CVPR 2019 Oral)
Stars: ✭ 93 (+60.34%)
Mutual labels:  representation-learning
self-supervised
Whitening for Self-Supervised Representation Learning | Official repository
Stars: ✭ 83 (+43.1%)
Mutual labels:  representation-learning
DiffuseVAE
A combination of VAE's and Diffusion Models for efficient, controllable and high-fidelity generation from low-dimensional latents
Stars: ✭ 81 (+39.66%)
Mutual labels:  generative-model
simclr-pytorch
PyTorch implementation of SimCLR: supports multi-GPU training and closely reproduces results
Stars: ✭ 89 (+53.45%)
Mutual labels:  representation-learning
awesome-contrastive-self-supervised-learning
A comprehensive list of awesome contrastive self-supervised learning papers.
Stars: ✭ 748 (+1189.66%)
Mutual labels:  representation-learning
timbre painting
Hierarchical fast and high-fidelity audio generation
Stars: ✭ 67 (+15.52%)
Mutual labels:  generative-model
batter-pitcher-2vec
A model for learning distributed representations of MLB players.
Stars: ✭ 75 (+29.31%)
Mutual labels:  representation-learning
BtcDet
Behind the Curtain: Learning Occluded Shapes for 3D Object Detection
Stars: ✭ 104 (+79.31%)
Mutual labels:  generative-model
HCFlow
Official PyTorch code for Hierarchical Conditional Flow: A Unified Framework for Image Super-Resolution and Image Rescaling (HCFlow, ICCV2021)
Stars: ✭ 140 (+141.38%)
Mutual labels:  normalizing-flow
sparselandtools
✨ A Python package for sparse representations and dictionary learning, including matching pursuit, K-SVD and applications.
Stars: ✭ 55 (-5.17%)
Mutual labels:  sparse-coding
entity-embed
PyTorch library for transforming entities like companies, products, etc. into vectors to support scalable Record Linkage / Entity Resolution using Approximate Nearest Neighbors.
Stars: ✭ 96 (+65.52%)
Mutual labels:  representation-learning
EgoNet
Official project website for the CVPR 2021 paper "Exploring intermediate representation for monocular vehicle pose estimation"
Stars: ✭ 111 (+91.38%)
Mutual labels:  representation-learning

RG-Flow

This repository contains the code for the paper "RG-Flow: A hierarchical and explainable flow model based on renormalization group and sparse prior" (arXiv:2010.00029).

Flow-based generative models have become an important class of unsupervised learning approaches. In this work, we incorporate the key ideas of renormalization group (RG) and sparse prior distribution to design a hierarchical flow-based generative model, called RG-Flow, which can separate different scale information of images with disentangled representations at each scale.

Dependencies

The code requires Python >= 3.7 and PyTorch >= 1.6, with optional CUDA support. Other dependencies can be installed via

pip install -r requirements.txt

Gallery

RG-Flow structure

Random walk in high-level latent representations

Random walk in mid-level latent representations

Learned receptive fields

Learned factors

Learned factors

High-level factor: emotion

High-level factor: emotion

High-level factor: gender

High-level factor: gender

High-level factor: light direction

High-level factor: light direction

High-level factor: rotation

High-level factor: rotation

High-level factor: hair color

High-level factor: hair

Mid-level factor: eyebrows

Mid-level factor: eyebrow

Mid-level factor: eyes

Mid-level factor: eye

Face mixing in the scaling direction

Running experiments

main.py is the code for training the network. All adjustable arguments are stored in args.py, together with their default values when we were training on the CelebA dataset. They can be displayed via python main.py --help:

usage: main.py [-h] [--data {celeba32,celeba64,mnist32,cifar10,chair600}] [--data_path DATA_PATH]
               [--nchannels NCHANNELS] [--L L] [--prior {gaussian,laplace}] [--subnet {rnvp,ar}]
               [--kernel_size KERNEL_SIZE] [--nlayers NLAYERS] [--nresblocks NRESBLOCKS]
               [--nmlp NMLP] [--nhidden NHIDDEN] [--dtype {float32,float64}]
               [--batch_size BATCH_SIZE] [--lr LR] [--weight_decay WEIGHT_DECAY] [--epoch EPOCH]
               [--clip_grad CLIP_GRAD] [--no_stdout] [--print_step PRINT_STEP]
               [--save_epoch SAVE_EPOCH] [--keep_epoch KEEP_EPOCH] [--plot_epoch PLOT_EPOCH]
               [--cuda CUDA] [--out_infix OUT_INFIX] [-o OUT_DIR]

optional arguments:
  -h, --help            show this help message and exit

dataset parameters:
  --data {celeba32,celeba64,mnist32,cifar10,chair600}
                        dataset name
  --data_path DATA_PATH
                        dataset path
  --nchannels NCHANNELS
                        number of channels
  --L L                 edge length of images

network parameters:
  --prior {gaussian,laplace}
                        prior of latent variables
  --subnet {rnvp,ar}    type of subnet in an RG block
  --kernel_size KERNEL_SIZE
                        edge length of an RG block
  --nlayers NLAYERS     number of subnet layers in an RG block
  --nresblocks NRESBLOCKS
                        number of residual blocks in a subnet layer
  --nmlp NMLP           number of MLP hidden layers in an residual block
  --nhidden NHIDDEN     width of MLP hidden layers
  --dtype {float32,float64}
                        dtype

optimizer parameters:
  --batch_size BATCH_SIZE
                        batch size
  --lr LR               learning rate
  --weight_decay WEIGHT_DECAY
                        weight decay
  --epoch EPOCH         number of epoches
  --clip_grad CLIP_GRAD
                        global norm to clip gradients, 0 for disabled

system parameters:
  --no_stdout           do not print log to stdout, for better performance
  --print_step PRINT_STEP
                        number of batches to print log, 0 for disabled
  --save_epoch SAVE_EPOCH
                        number of epochs to save network weights, 0 for disabled
  --keep_epoch KEEP_EPOCH
                        number of epochs to keep saved network weights, 0 for disabled
  --plot_epoch PLOT_EPOCH
                        number of epochs to plot samples, 0 for disabled
  --cuda CUDA           IDs of GPUs to use, empty for disabled
  --out_infix OUT_INFIX
                        infix in output filename to distinguish repeated runs
  -o OUT_DIR, --out_dir OUT_DIR
                        directory for output, empty for disabled

During training, the log file and the network weights will be saved in out_dir.

After the network is trained, plot_mix_temperature.py can be used to plot samples using mixed effective temperatures, described in Appendix B of the paper.

Citation

@article{hu2020rg,
title={RG-Flow: A hierarchical and explainable flow model based on renormalization group and sparse prior},
author={Hu, Hong-Ye and Wu, Dian and You, Yi-Zhuang and Olshausen, Bruno and Chen, Yubei},
journal={arXiv preprint arXiv:2010.00029},
year={2020}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].