GithubHelp home page GithubHelp logo

classicvalues / ml-cvpr2019-swd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apple/ml-cvpr2019-swd

1.0 1.0 0.0 2.5 MB

Sliced Wasserstein Discrepancy for Unsupervised Domain Adaptation. In CVPR 2019.

License: Other

Python 100.00%

ml-cvpr2019-swd's Introduction

Sliced Wasserstein Discrepancy for Unsupervised Domain Adaptation

IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2019.

[Paper]

Introduction

In this work, we connect two distinct concepts for unsupervised domain adaptation: feature distribution alignment between domains by utilizing the task-specific decision boundary and the Wasserstein metric. The proposed method is designed to work with high-dimensional/structured outputs where the probability measures do not have significant overlap. For example image classification for high number of classes, semantic segmentation, and object detection.

The code here is a basic illustration of the implementation for the intertwining moons 2D dataset. For the source samples, we generate an upper moon (blue points) and a lower moon (red points), labeled 0 and 1, respectively. The target samples are generated from the same distribution as the source samples but with added domain shifts by rotation and translation. The model consists of a 3-layered fully-connected network for a feature generator and 3-layered fully-connected networks for classifiers.

This is for demonstration purposes only. Please see the paper for more details.

Getting Started

This code is designed to work with Python 2.7.10. Virtualenv is recommended. Use pip to install dependencies

pip install -r requirements.txt

To run the demo in Python 3, please modify the requirements.txt with tensorflow==1.13.1 and matplotlib==3.1.0

Running the code

To run the demo with adaptation:

python swd.py -mode adapt_swd

To run the demo without adaptation:

python swd.py -mode source_only

Interpreting Outputs

Outputs will be saved as png and gif files in the current folder for each mode. The outputs show the source and target samples with the current decision boundary. ย 

ml-cvpr2019-swd's People

Contributors

classicvalues avatar dependabot[bot] avatar davelester avatar imgbotapp avatar mend-bolt-for-github[bot] avatar

Stargazers

 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.