The repository contains reproducible PyTorch source code of our paper Generative Modeling with Optimal Transport Maps, ICLR 2022.

Overview

Generative Modeling with Optimal Transport Maps

The repository contains reproducible PyTorch source code of our paper Generative Modeling with Optimal Transport Maps, ICLR 2022. It focuses on Optimal Transport Modeling (OTM) in ambient space, e.g. spaces of high-dimensional images. While analogous approaches consider OT maps in the latent space of an autoencoder, this paper focuses on fitting an OT map directly between noise and ambient space. The method is evaluated on generative modeling and unpaired image restoration tasks. In particular, large-scale computer vision problems, such as denoising, colorization, and inpainting are considered in unpaired image restoration. The overall pipeline of OT as generative map and OT as cost of generative model is given below.

Latent Space Optimal Transport

Our method is different from the prevalent approach of OT in the latent space shown below.

Ambient Space Mass Transport

The scheme of our approach for learning OT maps between unequal dimensions.

Prerequisites

The implementation is GPU-based. Single GPU (V100) is enough to run each experiment. Tested with torch==1.4.0 torchvision==0.5.0. To reproduce the reported results, consider using the exact version of PyTorch and its required dependencies as other versions might be incompatible.

Repository structure

All the experiments are issued in the form of pretty self-explanatory python codes.

Main Experiments

Execute the following commands in the source folder.

Training

  • python otm_mnist_32x22.py --train 1 -- OTM between noise and MNIST, 32x32, Grayscale;
  • python otm_cifar_32x32.py --train 1 -- OTM between noise and CIFAR10, 32x32, RGB;
  • python otm_celeba_64x64.py --train 1 -- OTM between noise and CelebA, 64x64, RGB;
  • python otm_celeba_denoise_64x64.py --train 1 -- OTM for unpaired denoising on CelebA, 64x64, RGB;
  • python otm_celeba_colorization_64x64.py --train 1 -- OTM for unpaired colorization on CelebA, 64x64, RGB;
  • python otm_celeba_inpaint_64x64.py --train 1 -- OTM unpaired inpainting on CelebA, 64x64, RGB.

Run inference with the best iteration.

Inference

  • python otm_mnist_32x32.py --inference 1 --init_iter 100000
  • python otm_cifar_32x32.py --inference 1 --init_iter 100000
  • python otm_celeba_64x64.py --inference 1 --init_iter 100000
  • python otm_celeba_denoise_64x64.py --inference 1 --init_iter 100000
  • python otm_celeba_colorization_64x64.py --inference 1 --init_iter 100000
  • python otm_celeba_inpaint_64x64.py --inference 1 --init_iter 100000

Toy Experiments in 2D

  • source/toy/OTM-GO MoG.ipynb -- Mixture of 8 Gaussians;
  • source/toy/OTM-GO Moons.ipynb -- Two Moons;
  • source/toy/OTM-GO Concentric Circles.ipynb -- Concentric Circles;
  • source/toy/OTM-GO S Curve.ipynb -- S Curve;
  • source/toy/OTM-GO Swirl.ipynb -- Swirl.

Refer to Credit Section for baselines.

Results

Optimal transport modeling between high-dimensional noise and ambient space.

Randomly generated samples

Optimal transport modeling for unpaired image restoration tasks.

Following is the experimental setup that is considered for unpaired image restoration.

OTM for image denoising on test C part of CelebA, 64 × 64.

OTM for image colorization on test C part of CelebA, 64 × 64.

OTM for image inpainting on test C part of CelebA, 64 × 64.

Optimal transport modeling for toy examples.

OTM in low-dimensional space, 2D.

Credits

Owner
Litu Rout
I am broadly interested in Optimization, Statistical Learning Theory, Interactive Machine Learning, and Optimal Transport.
Litu Rout
PyTorch implementation of Asymmetric Siamese (https://arxiv.org/abs/2204.00613)

Asym-Siam: On the Importance of Asymmetry for Siamese Representation Learning This is a PyTorch implementation of the Asym-Siam paper, CVPR 2022: @inp

Meta Research 89 Dec 18, 2022
Semantic Segmentation in Pytorch

PyTorch Semantic Segmentation Introduction This repository is a PyTorch implementation for semantic segmentation / scene parsing. The code is easy to

Hengshuang Zhao 1.2k Jan 01, 2023
Stacked Generative Adversarial Networks

Stacked Generative Adversarial Networks This repository contains code for the paper "Stacked Generative Adversarial Networks", CVPR 2017. Part of the

Xun Huang 241 May 07, 2022
Yolox-bytetrack-sample - Python sample of MOT (Multiple Object Tracking) using YOLOX and ByteTrack

yolox-bytetrack-sample YOLOXとByteTrackを用いたMOT(Multiple Object Tracking)のPythonサン

KazuhitoTakahashi 12 Nov 09, 2022
Tutoriais publicados nas nossas redes sociais para obtenção de dados, análises simples e outras tarefas relevantes no mercado financeiro.

Tutoriais Públicos Tutoriais publicados nas nossas redes sociais para obtenção de dados, análises simples e outras tarefas relevantes no mercado finan

Trading com Dados 68 Oct 15, 2022
a general-purpose Transformer based vision backbone

Swin Transformer By Ze Liu*, Yutong Lin*, Yue Cao*, Han Hu*, Yixuan Wei, Zheng Zhang, Stephen Lin and Baining Guo. This repo is the official implement

Microsoft 9.9k Jan 08, 2023
CAPITAL: Optimal Subgroup Identification via Constrained Policy Tree Search

CAPITAL: Optimal Subgroup Identification via Constrained Policy Tree Search This repository is the official implementation of CAPITAL: Optimal Subgrou

Hengrui Cai 0 Oct 19, 2021
Official code of the paper "ReDet: A Rotation-equivariant Detector for Aerial Object Detection" (CVPR 2021)

ReDet: A Rotation-equivariant Detector for Aerial Object Detection ReDet: A Rotation-equivariant Detector for Aerial Object Detection (CVPR2021), Jiam

csuhan 334 Dec 23, 2022
A Real-Time-Strategy game for Deep Learning research

Description DeepRTS is a high-performance Real-TIme strategy game for Reinforcement Learning research. It is written in C++ for performance, but provi

Centre for Artificial Intelligence Research (CAIR) 156 Dec 19, 2022
[ICCV'21] PlaneTR: Structure-Guided Transformers for 3D Plane Recovery

PlaneTR: Structure-Guided Transformers for 3D Plane Recovery This is the official implementation of our ICCV 2021 paper News There maybe some bugs in

73 Nov 30, 2022
DA2Lite is an automated model compression toolkit for PyTorch.

DA2Lite (Deep Architecture to Lite) is a toolkit to compress and accelerate deep network models. ⭐ Star us on GitHub — it helps!! Frameworks & Librari

Sinhan Kang 7 Mar 22, 2022
Lightweight plotting to the terminal. 4x resolution via Unicode.

Uniplot Lightweight plotting to the terminal. 4x resolution via Unicode. When working with production data science code it can be handy to have plotti

Olav Stetter 203 Dec 29, 2022
[ACM MM 2021] Diverse Image Inpainting with Bidirectional and Autoregressive Transformers

Diverse Image Inpainting with Bidirectional and Autoregressive Transformers Installation pip install -r requirements.txt Dataset Preparation Given the

Yingchen Yu 25 Nov 09, 2022
2020 CCF大数据与计算智能大赛-非结构化商业文本信息中隐私信息识别-第7名方案

2020CCF-NER 2020 CCF大数据与计算智能大赛-非结构化商业文本信息中隐私信息识别-第7名方案 bert base + flat + crf + fgm + swa + pu learning策略 + clue数据集 = test1单模0.906 词向量

67 Oct 19, 2022
Arabic Car License Recognition. A solution to the kaggle competition Machathon 3.0.

Transformers Arabic licence plate recognition 🚗 Solution to the kaggle competition Machathon 3.0. Ranked in the top 6️⃣ at the final evaluation phase

Noran Hany 17 Dec 04, 2022
Reimplementation of Learning Mesh-based Simulation With Graph Networks

Pytorch Implementation of Learning Mesh-based Simulation With Graph Networks This is the unofficial implementation of the approach described in the pa

Jingwei Xu 33 Dec 14, 2022
NAS-FCOS: Fast Neural Architecture Search for Object Detection (CVPR 2020)

NAS-FCOS: Fast Neural Architecture Search for Object Detection This project hosts the train and inference code with pretrained model for implementing

Ning Wang 180 Dec 06, 2022
Voxel-based Network for Shape Completion by Leveraging Edge Generation (ICCV 2021, oral)

Voxel-based Network for Shape Completion by Leveraging Edge Generation This is the PyTorch implementation for the paper "Voxel-based Network for Shape

10 Dec 04, 2022
Tree Nested PyTorch Tensor Lib

DI-treetensor treetensor is a generalized tree-based tensor structure mainly developed by OpenDILab Contributors. Almost all the operation can be supp

OpenDILab 167 Dec 29, 2022
GLNet for Memory-Efficient Segmentation of Ultra-High Resolution Images

GLNet for Memory-Efficient Segmentation of Ultra-High Resolution Images Collaborative Global-Local Networks for Memory-Efficient Segmentation of Ultra-

VITA 298 Dec 12, 2022