Source code of: "Discriminative Adversarial Domain Generalization with Meta-learning based Cross-domain Validation"
-
Preparation:
1.1 Get data:
Please download the folder "data" from: https://drive.google.com/file/d/1oLx0-iOIoci0yLo093HGqkFnBFyC6imM/view?usp=sharing, and store the folder at the same path of code.
1.2 Load the pretrain AlexNet:
Please download the alexnet model from: https://drive.google.com/file/d/1WkDSnZYofOnK39-OW2oXZlJjmhlzXdKx/view?usp=sharing, and store it at the same path of code.
-
Create empty folder "Best_models" to store the models.
-
To reproduce the result of PACS on AlexNet:
Run "run_PACS.sh" to reproduce the result (target domain: cartoon) of PACS on AlexNet.
-
To reproduce the result of other domains, change the command in "run_PACS.sh" to:
python run_idea.py --source _ _ _ --target _
-
To reproduce the result on ResNet18, change the command in "run_PACS.sh" to:
python run_idea.py --source _ _ _ --target _ --model_name resnet18,
where the "_" should the domain name (P/A/C/S)