Implementation of "Adversarial Discriminative Domain Adaptation" in PyTorch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

4 years ago
# ADDA.PyTorch-resnet
4 years ago
Implementation of "Adversarial Discriminative Domain Adaptation" in PyTorch.
6 years ago
This repo is mostly based on https://github.com/Fujiki-Nakamura/ADDA.PyTorch
6 years ago
## Note
Before running the training code, make sure that `DATASETDIR` environment variable is set to dataset directory.
## Environment
- Python 3.8.5
- PyTorch 1.6.0
6 years ago
## Example
For training on SVHN-MNIST
6 years ago
```
$ python train_source.py --logdir outputs
$ python main.py --logdir outputs --trained outputs/best_model.pt --slope 0.2
```
6 years ago
For training on Office dataset using ResNet-50
```
$ python core/train_source_rn50.py --n_classes 31 --lr 1e-5 --src_cat amazon --tgt_cat webcam
$ python main.py --n_classes 31 --trained outputs/garbage/best_model.pt --lr 1e-5 --d_lr 1e-4 --logdir outputs --model resnet50 --src-cat amazon --tgt-cat webcam
```
6 years ago
## Result
### SVHN -> MNIST
4 years ago
| | Paper | This Repo |
6 years ago
| --- | --- | --- |
| Source only | 0.601 | 0.646 |
| ADDA | 0.760 | 0.805 |
6 years ago
4 years ago
### Office-31 Amazon -> Office-31 Webcam
| | Paper | This Repo |
| --- | --- | --- |
| Source only | 0.684 | 0.714 |
| ADDA | 0.862 | 0.831 |
4 years ago
## Resources
6 years ago
- https://arxiv.org/pdf/1702.05464.pdf
- https://github.com/Fujiki-Nakamura/ADDA.PyTorch
- https://github.com/erictzeng/adda/issues/11
- https://github.com/corenel/pytorch-adda/issues/15