githubljk / WANN

Adversarial Weighting for Domain Adaptation in Regression

Home Page:https://anonymousaccount0.github.io/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WANN

Weighting Adversarial Neural Network

An online demo of the algorithm is available at https://anonymousaccount0.github.io/demo/

Synthetic Experiment Setup No Reweighting
TrAdaBoostR2 WANN

WANN is a supervised domain adaptation method suited for regression tasks. The algorithm is an instance-based method which learns a reweighting of source instance losses in order to correct the difference between source and target distributions.

model

WANN algorithm consists to train three networks in parallel in the same gradient descent. The weighting network W learns the source instances weights which are multiplied to the source losses of the task and discrepancy networks ht and hd. The last network, which estimates the Y-discrepancy between the reweighted source and target instances, is trained with an opposite objective function (-G) than the two others. This is done by using a Reversal Gradient Layer (RGL) in bold on the Figure.

Requirements

Code for the numerical experiments requires the following packages:

  • tensorflow (>= 2.0)
  • scikit-learn
  • numpy
  • cvxopt
  • nltk (for sentiment analysis pre-processing)
  • matplotlib (for visualization)

The file environment.yml can be used to reproduce the same conda environment as the one used to conduct the experiments with the following command line:

$ conda env create -f environment.yml

⚠️ The environment has been built on Windows, it seems that the above command line does not work on Ubuntu. If you use this operating system, please create a new environment and install the above packages using conda install or pip install.

Experiments

WANN algorithm is compared to several instances-based domain adaptation base-lines:

The implementation of the methods can be found in the wann\methods folder. For GDM, code can be found at https://cims.nyu.edu/~munoz/

The experiments are conducted on one synthetic and three benchmark datasets:

Synthetic Experiment

The code of the synthetic experiment can be found in the following notebook notebooks\Toy_experiments.ipynb

comp

Superconductivity Experiments

Running superconductivity experiments can be done in two ways:

  • In the command line with: $ python wann\uci_experiments.py
  • Within the following notebooks: notebooks\UCI_experiments.ipynb

uci

Kin Experiments

Running kin experiments can be done in two ways:

  • In the command line with: $ python wann\kin_experiments.py
  • Within the following notebooks: notebooks\Kin_experiments.ipynb

kin

Sentiment Analysis Experiments

Running sentiment analysis experiments can be done in two ways:

  • In the command line with: $ python wann\sa_experiments.py
  • Within the following notebooks: notebooks\sa_experiments.ipynb

sa

About

Adversarial Weighting for Domain Adaptation in Regression

https://anonymousaccount0.github.io/demo/


Languages

Language:Jupyter Notebook 79.8%Language:Python 20.2%