MCPcopy Index your code
hub / github.com/Albert0147/AaD_SFDA

github.com/Albert0147/AaD_SFDA @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
202 symbols 702 edges 22 files 4 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

(NeurIPS 2022 Spotlight) Attracting and Dispersing: A Simple Approach for Source-free Domain Adaptation

Shiqi Yang, Yaxing Wang, Kai Wang, Shangling Jui and Joost van de Weijer

Code for our paper 'Attracting and Dispersing: A Simple Approach for Source-free Domain Adaptation'

[project][arxiv]

Contributions

  • We provide a surprisingly simple solution for source-free domain adaptation, which is an upperbound of the proposed clustering objective:

img

  • And we can relate several methods in domain adaptation, source-free domain adaptation and contrastive learning via the perspective of discriminability and diversity:

img2

code on VisDA

We use pytoch 1.3 with cuda 10.0

Attention: Please note that the kl_div in pytorch equals to dot product if there is no log for the input.

Download VisDA dataset and change the path in the code to it. First train model on Source domain, directly run src_pretrain.py Source-free domain adaptation, directly run tar_adaptation.py

You can insert the core part (loss computing starting in Line 297 in tar_adaptation.py) into code of any other SFDA method, such as our NRC (NeurIPS 2021) or SHOT (ICML 2020)

For computing SND, you can use the file snd.py (code is from SND), in the paper we compute SND after only training for a few epochs (~5 on visda).

LICENSE

CC BY 4.0

Core symbols most depended-on inside this repo

cal_acc_
called by 6
office-home/utils.py
image_train
called by 6
office-home/utils.py
image_target
called by 6
office-home/utils.py
image_test
called by 6
office-home/utils.py
office_load
called by 4
office-home/utils.py
cal_acc
called by 4
oda/image_source.py
cal_acc
called by 3
src_pretrain.py
make_dataset
called by 3
office-home/utils.py

Shape

Function 129
Method 51
Class 22

Languages

Python100%

Modules by API surface

office-home/utils.py20 symbols
oda/network.py20 symbols
office-home/train_tar.py11 symbols
oda/data_list.py11 symbols
network.py11 symbols
data_list.py11 symbols
tar_adaptation.py10 symbols
src_pretrain.py10 symbols
oda/image_source.py10 symbols
office-home/office31_tar.py9 symbols
oda/tar_open.py9 symbols
oda/image_target_oda.py9 symbols

For agents

$ claude mcp add AaD_SFDA \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact