Giter VIP home page Giter VIP logo

grda's Introduction

Graph-Relational Domain Adaptation (GRDA)

This repo contains the code for our ICLR 2022 paper:
Graph-Relational Domain Adaptation
Zihao Xu, Hao He, Guang-He Lee, Yuyang Wang, Hao Wang
Tenth International Conference on Learning Representations (ICLR), 2022
[Paper] [Talk] [Slides][TPT-48 Dataset]

Beyond Domain Adaptation: Brief Introduction for GRDA

Essentially GRDA goes beyond current (categorical) domain adaptation regime and proposes the first approach to adapt across graph-relational domains. We introduce a new notion, dubbed "domain graph", that to encode domain adjacency, e.g., a graph of states in the US with each state as a domain and each edge indicating adjacency. Theoretical analysis shows that at equilibrium, GRDA recovers classic domain adaptation when the graph is a clique, and achieves non-trivial alignment for other types of graphs. See the following example (black nodes as source domains and white nodes as target domains).

Sample Results

In a DA problem with 15 domains connected by a domain graph (see the figure below), if we use domains 0, 3, 4, 8, 12, 14 as source domains (left of the following figure) and the rest as target domains, below are some sample results from previous domain adaptation methods and GRDA (right of the figure), where GRDA successfully generalizes across different domains in the graph.

Method Overview

We provide a simple yet effective learning framework with theoretical guarantees (see the Theory section at the end of this README). Below is a quick comparison between previous domain adaptation methods and GRDA (differences marked in red).

  • Previous domain adaptation methods use a discriminator is classifify different domains (as categorical values), while GRDA's discriminator directly reconstructs the domain graph (as a adjacency matrix).
  • Previous domain adaptation methods' encoders ignore domain IDs, while GRDA takes the domain IDs with the domain graph as input.

Quantitative Result

Toy Dataset: DG-15 and DG-60

TPT-48

CompCars

Theory (Informal)

  • Traditional DA is equivalent to using our GRDA with a fully-connected graph (i.e., a clique).
  • D and E converge if and only if ๐”ผi~p(u|e),j~p(u|e')[Ai,j|e, e'] = ๐”ผi,j[Ai,j].
  • The global optimum of the two-player game between E and D matches the three-player game between E, D, and F.

Installation

pip install -r requirements.txt

How to Train GRDA

python main.py

Visualization

We use visdom to visualize. We assume the code is run on a remote gpu machine.

Change Configurations

Find the config in "config" folder. Choose the config you need and Set "opt.use_visdom" to "True".

Start a Visdom Server on Your Machine

python -m visdom.server -p 2000

Now connect your computer with the gpu server and forward the port 2000 to your local computer. You can now go to: http://localhost:2000 (Your local address) to see the visualization during training.

Also Check Out Relevant Work

Continuously Indexed Domain Adaptation
Hao Wang*, Hao He*, Dina Katabi
Thirty-Seventh International Conference on Machine Learning (ICML), 2020
[Paper] [Code] [Talk] [Blog] [Slides]

Reference

Graph-Relational Domain Adaptation

@inproceedings{GRDA,
  title={Graph-Relational Domain Adaptation},
  author={Xu, Zihao and He, Hao and Lee, Guang-He and Wang, Yuyang and Wang, Hao},
  booktitle={International Conference on Learning Representations},
  year={2022}
}

grda's People

Contributors

js05212 avatar shsjxzh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grda's Issues

low accuracy on DG-15

After downloading the code, I follow the instructions provided and run the code on the DG-15 dataset without any modification. However, the accuracy is very low on DG-15 (64% total accuracy). Do you know the possible reasons behind this unexpected outcome?

The last two lines of the log are:
"epoch 499: {'E_pred': -8.388452115468681e-05, 'E_gan': -10.397211074829102, 'D': 10.397211074829102}
[Test][499] Accuracy: total average 64.0, test average 40.0, in each domain [100. 0. 49. 100. 100. 100. 37. 0. 100. 5. 18. 96. 100. 55. 100.]"

A question about g_encode and GNet

Hello,I am a student learning about this excellent paper, it's truely an extrodinary work. But when I learn the source code, I find it's difficult for me to understand the opt.use_g_encode = False and Class GNet. What do they mean? Could you please share about it? Thanks so much!

question regarding the paper

May I pose a question regarding the paper? What sets apart Corollary 4.1 from Corollary 4.3? It appears that in Corollary 4.1, achieving the global optimum necessitates uniform alignment, whereas in Corollary 4.3, it does not (the uniform alignment is relaxed).

Corollary 4.1. For GRDA, the global optimum of total loss Ld(D, E) is achieved if the encoding of all domains (indexed by u) are perfectly (uniformly) aligned, i.e., e โŠฅ u.
Corollary 4.3 (Star Graphs). In a star graph, the GRDA optimum is achieved if and only if the embedding distribution of the center domain is the average of all peripheral domains.

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.