Giter Site home page Giter Site logo

ot-icnn's Introduction

OT-ICNN

Code and dataset for the article optimal transport mapping via input convex neural neworks

Optimal transport mapping via input convex neural networks

The following are the details for all the experiments reported in the paper. First we present the training details for various methods and then include the details for plotting the figures presented in the paper.

Training the models

2-dimensional experiments (2_dim_experiments/)

Baselines (2_dim_experiments/baselines/)

## Checkerboard dataset

# Barycentric-OT
python main.py --solver=bary_ot --dual_iters=200000 --map_iters=200000 --data=our_checkerboard

# W2-GAN
python main.py --solver=w2 --gen=1  --train_iters=200000 --data=our_checkerboard

# W1-LP
python main.py --solver=w1 --clamp --train_iters=200000 --data=our_checkerboard


## Mixture of eight Gaussians dataset

# Barycentric-OT
python main.py --solver=bary_ot --dual_iters=200000 --map_iters=200000 --data=8gaussians

# W2-GAN
python main.py --solver=w2 --gen=1  --train_iters=200000 --data=8gaussians

# W1-LP
python main.py --solver=w1 --clamp --train_iters=200000 --data=8gaussians

Our algorithm (2_dim_experiments/)

## Checkerboard dataset
python W2-minimax-tf.py --DATASET_X = 'checker_board_four' --DATASET_Y='checker_board_five'

## Mixture of eight Gaussians dataset
python W2-minimax-tf.py --DATASET_X = '8gaussians' --DATASET_Y='simpleGaussian' --BATCH_SIZE = 256

High dimensional experiments (High_dim_experiments/)

## Gaussian -> Gaussian. The parameter SCALE in the code is $\alpha$ in the paper.
python Gaussian_to_Gaussian.py --SCALE=10.0

## Gaussian -> Mixture of Gaussian.
python GMM_to_GMM.py

## MNIST {0,1,2,3,4} -> MNIST {5,6,7,8,9}.
python vaeMNIST_to_vaeMNIST.py 

## Gaussian -> MNIST.
python Gaussian_to_vaeMNIST.py 

Plotting the figures in paper

2-dimensional experiments (2_dim_experiments/)

python create-2dim-figures.py

High dimensional experiments (High_dim_experiments/)

## Figure for Gaussian -> Gaussian. 
python Gaussian_to_Gaussian_Plots.py

## Table for Gausian -> Gaussian: The relative error values for mean vectors in Table 1 are stored in the file 'relative_mean_loss_stuff.csv' for $\alpha=1, 5, 10$ over 4 different trials.

## Gaussian -> Mixture of Gaussian.
python create-GMM-figure.py

## MNIST {0,1,2,3,4} -> MNIST {5,6,7,8,9}.
python MNIST_to_MNIST_Plots.py

## Gaussian -> MNIST.
python Gaussian_to_MNIST_Plots.py

Acknowledgments

* https://github.com/jshe/wasserstein-2
* https://github.com/mikigom/large-scale-OT-mapping-TF.git
* https://github.com/igul222/improved_wgan_training.git

Dependencies

torch (0.4.1)
tensorflow (1.12.0)
numpy (1.14.3)
h5py (2.7.1)
torchvision (0.2.1)
scikit-learn (sklearn) (0.19.1)
matplotlib (2.2.2)
python (3.6)
tensorboardX (optional, remove dependency if not used)

ot-icnn's People

Contributors

amirtag 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.