PyTorch implementation for Larger Norm More Transferable: An Adaptive Feature Norm Approach for Unsupervised Domain Adaptation.
-
Platform : Linux
-
Hardware : Nvidia GPU
-
Others:
- CUDA 9.0.176
- PyTorch 0.4.1
- tqdm
Please follow the README.md in subfolder Data
to organize datasets
-
Make sure you have organized datasets and satisfied the requirements.
-
According to the hierarchy in following block, enter corresponding setting ,dataset and method folder.
-
Modify parameters:
data_root
,result
andsnapshot
inmain.sh
οΌand can switch model through changingmodel
. -
If you want to run the IAFN+ENT mothod on Office-31 or ImageCLEF-DA, you have to modify the command
CUDA_VISIBLE_DEVICES=${gpu_id} python train.py \
toCUDA_VISIBLE_DEVICES=${gpu_id} python train_ent.py \
-
run
bash main.sh
in your terminal
.
βββ README.md
βββ data
βΒ Β βββ ImageCLEF
βΒ Β βββ Office31
βΒ Β βββ OfficeHome
βΒ Β βββ README.md
βΒ Β βββ Visda2017
βββ partial
βΒ Β βββ OfficeHome
βΒ Β βΒ Β βββ HAFN
βΒ Β βΒ Β βββ SAFN
βΒ Β βββ README.md
βΒ Β βββ Visda2017
βΒ Β βββ HAFN
βΒ Β βββ SAFN
βββ resources
βββ vanilla
βββ ImageCLEF
βΒ Β βββ HAFN
βΒ Β βββ SAFN
βββ Office31
βΒ Β βββ HAFN
βΒ Β βββ SAFN
βββ README.md
βββ Visda2017
βββ HAFN
βββ SAFN
Here are some description of parameters :
data_root
: the directory of data.snapshot
: the directory to store and load state dicts.result
: the directory that store evaluating results.post
: distinguish each experiment.repeat
: distinguish each repeated result in a experiment.gpu_id
: the GPU ID to run experiments.model
: switch model betweenresnet101
andresnet50
If you use AFN in your research, please consider citing:
@InProceedings{Xu_2019_ICCV,
author = {Xu, Ruijia and Li, Guanbin and Yang, Jihan and Lin, Liang},
title = {Larger Norm More Transferable: An Adaptive Feature Norm Approach for Unsupervised Domain Adaptation},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
month = {October},
year = {2019}
}