All Projects → pumpikano → Tf Dann

pumpikano / Tf Dann

Domain-Adversarial Neural Network in Tensorflow

Projects that are alternatives of or similar to Tf Dann

Gvb
Code of Gradually Vanishing Bridge for Adversarial Domain Adaptation (CVPR2020)
Stars: ✭ 52 (-90.65%)
Mutual labels:  domain-adaptation, adversarial-learning
Advertorch
A Toolbox for Adversarial Robustness Research
Stars: ✭ 826 (+48.56%)
Mutual labels:  jupyter-notebook, adversarial-learning
Awesome Domain Adaptation
A collection of AWESOME things about domian adaptation
Stars: ✭ 3,357 (+503.78%)
Mutual labels:  domain-adaptation, adversarial-learning
Adaptsegnet
Learning to Adapt Structured Output Space for Semantic Segmentation, CVPR 2018 (spotlight)
Stars: ✭ 654 (+17.63%)
Mutual labels:  domain-adaptation, adversarial-learning
Transferable-E2E-ABSA
Transferable End-to-End Aspect-based Sentiment Analysis with Selective Adversarial Learning (EMNLP'19)
Stars: ✭ 62 (-88.85%)
Mutual labels:  adversarial-learning, domain-adaptation
Clan
( CVPR2019 Oral ) Taking A Closer Look at Domain Shift: Category-level Adversaries for Semantics Consistent Domain Adaptation
Stars: ✭ 248 (-55.4%)
Mutual labels:  domain-adaptation, adversarial-learning
Boltzmann Machines
Boltzmann Machines in TensorFlow with examples
Stars: ✭ 768 (+38.13%)
Mutual labels:  jupyter-notebook, tensorflow-models
Advanced Gradient Obfuscating
Take further steps in the arms race of adversarial examples with only preprocessing.
Stars: ✭ 28 (-94.96%)
Mutual labels:  jupyter-notebook, adversarial-learning
Tensorflow shiny
A R/Shiny app for interactive RNN tensorflow models
Stars: ✭ 118 (-78.78%)
Mutual labels:  jupyter-notebook, tensorflow-models
Multimodal Short Video Dataset And Baseline Classification Model
500,000 multimodal short video data and baseline models. 50万条多模态短视频数据集和基线模型(TensorFlow2.0)。
Stars: ✭ 60 (-89.21%)
Mutual labels:  jupyter-notebook, tensorflow-models
adapt
Awesome Domain Adaptation Python Toolbox
Stars: ✭ 46 (-91.73%)
Mutual labels:  adversarial-learning, domain-adaptation
CADA
Attending to Discriminative Certainty for Domain Adaptation
Stars: ✭ 17 (-96.94%)
Mutual labels:  adversarial-learning, domain-adaptation
Generative Adversarial Networks
Introduction to generative adversarial networks, with code to accompany the O'Reilly tutorial on GANs
Stars: ✭ 505 (-9.17%)
Mutual labels:  jupyter-notebook, tensorflow-models
Probabilistic Programming And Bayesian Methods For Hackers
aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
Stars: ✭ 23,912 (+4200.72%)
Mutual labels:  jupyter-notebook
Go Profiler Notes
felixge's notes on the various go profiling methods that are available.
Stars: ✭ 525 (-5.58%)
Mutual labels:  jupyter-notebook
Handson Ml
A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in python using Scikit-Learn and TensorFlow.
Stars: ✭ 23,798 (+4180.22%)
Mutual labels:  jupyter-notebook
Machine Learning Notes
My continuously updated Machine Learning, Probabilistic Models and Deep Learning notes and demos (2000+ slides) 我不间断更新的机器学习,概率模型和深度学习的讲义(2000+页)和视频链接
Stars: ✭ 5,390 (+869.42%)
Mutual labels:  jupyter-notebook
Reinforce
Reinforcement Learning Algorithm Package & PuckWorld, GridWorld Gym environments
Stars: ✭ 552 (-0.72%)
Mutual labels:  jupyter-notebook
Data Structures Using Python
This is my repository for Data Structures using Python
Stars: ✭ 546 (-1.8%)
Mutual labels:  jupyter-notebook
Flowtron
Flowtron is an auto-regressive flow-based generative network for text to speech synthesis with control over speech variation and style transfer
Stars: ✭ 546 (-1.8%)
Mutual labels:  jupyter-notebook

Domain-Adversarial Training of Neural Networks in Tensorflow

"Unsupervised Domain Adaptation by Backpropagation" introduced a simple and effective method for accomplishing domain adaptation with SGD with a gradient reversal layer. This work was elaborated and extended in "Domain-Adversarial Training of Neural Networks". For more information as well as a link to an equivalent implementation in Caffe, see http://sites.skoltech.ru/compvision/projects/grl/.

The Blobs-DANN.ipynb shows some basic experiments on a very simple dataset. The MNIST-DANN.ipynb recreates the MNIST experiment from the papers on a synthetic dataset. Instructions to generate the synthetic dataset are below.

Requires TensorFlow>=1.0 and tested with Python 2.7 and Python 3.4.

Gradient Reversal Layer

The flip_gradient operation is implemented in Python by using tf.gradient_override_map to override the gradient of tf.identity. Refer to flip_gradient.py to see how this is implemented.

from flip_gradient import flip_gradient

# Flip the gradient of y w.r.t. x and scale by l (defaults to 1.0)
y = flip_gradient(x, l)

MNIST Experiments

The MNIST-DANN.ipynb notebook implements the MNIST experiments for the paper with the same model and optimization parameters, including the learning rate and adaptation parameter schedules. Rough results are below (more training would likely improve results - # epochs are not reported in the paper).

Method Target acc (paper) Target acc (this repo w/ 10 epochs)
Source Only 0.5225 0.4801
DANN 0.7666 0.7189

Build MNIST-M dataset

The MNIST-M dataset consists of MNIST digits blended with random color patches from the BSDS500 dataset. To generate a MNIST-M dataset, first download the BSDS500 dataset and run the create_mnistm.py script:

curl -L -O http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/BSR/BSR_bsds500.tgz
python create_mnistm.py

This may take a couple minutes and should result in a mnistm_data.pkl file containing generated images.

Contribution

It would be great to add other experiments to this repository. Feel free to make a PR if you decide to recreate other results from the papers or new experiments entirely.

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