Coder Social home page Coder Social logo

tomergalanti / riskboundscrossdomain Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.77 MB

Code for "Risk Bounds for Unsupervised Cross-Domain Mapping with IPMs", JMLR 2020

Jupyter Notebook 3.12% Python 94.75% TeX 0.38% Shell 1.23% Dockerfile 0.11% MATLAB 0.40%

riskboundscrossdomain's Introduction

Risk Bounds for Cross-Domain Mapping with IPMs

Pytorch implementation of "Risk Bounds for Cross-Domain Mapping with IPMs" Prerequisites

  • Python 2.7
  • Pytorch
  • Numpy/Scipy/Pandas
  • Progressbar
  • OpenCV

Download dataset

Download dataset [edges2shoes, edges2handbags, cityscapes, maps, facades]: bash datasets/download_pix2pix.sh $DATASET_NAME.

General GAN Bound (Alg.1 and Alg.2)

DiscoGAN: python ./discogan_arch/general_gan_bound_discogan.py --task_name=$DATASET_NAME

DistanceGAN: python ./discogan_arch/general_gan_bound_distancegan.py --task_name=$DATASET_NAME

Per Sample Bound (Alg.3)

Train G_1 model:

DiscoGAN: python ./discogan_arch/disco_gan_model.py --task_name=$DATASET_NAME --num_layers=3

DistanceGAN: python ./discogan_arch/general_gan_bound_distancegan.py --task_name=$DATASET_NAME

Then Train G_2:

DiscoGAN: python ./discogan_arch/gan_bound_per_sample_discogan.py --task_name=$DATASET_NAME --pretrained_generator_A_path='./models/model_gen_A-10' --pretrained_generator_B_path='./models/model_gen_B-10' --pretrained_discriminator_A_path='./models/model_dis_A-10' --pretrained_discriminator_B_path='./models/model_dis_B-10' --one_sample_index=$SAMPLE_NUMBER

DistanceGAN: python ./discogan_arch/gan_bound_per_sample_distancegan.py --task_name=$DATASET_NAME --pretrained_generator_A_path='./models/model_gen_A-10' --pretrained_generator_B_path='./models/model_gen_B-10' --pretrained_discriminator_A_path='./models/model_dis_A-10' --pretrained_discriminator_B_path='./models/model_dis_B-10' --one_sample_index=$SAMPLE_NUMBER

Options

Additional options can be found in ./discogan_arch/discogan_based_options/options.py

For specific configuration see DistanceGAN and DiscoGAN

Reference

If you found this code useful, please cite the following paper:

@article{galanti2020risk,
   author={Tomer Galanti and Sagie Benaim and Lior Wolf},
  title={Risk Bounds for Unsupervised Cross-Domain Mapping with IPMs},
  journal = {Journal of Machine Learning Research},
  year    = {2021},
}

Acknowledgements

This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant ERC CoG 725974).

The code is based on the following github repositories:

  1. CycleGAN (https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)
  2. DiscoGAN (https://github.com/SKTBrain/DiscoGAN)
  3. DistanceGAN (https://github.com/sagiebenaim/DistanceGAN)
  4. Hyperband (https://github.com/zygmuntz/hyperband).

riskboundscrossdomain's People

Contributors

tomergalanti avatar

Watchers

 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.