Foresee What You Will Learn: Data Augmentation for Domain Generalization in Non-Stationary Environments
[Paper] This is the authors' official PyTorch implementation for Directional Data Augmentation (DDA) method in the AAAI 2023 paper Foresee What You Will Learn: Data Augmentation for Domain Generalization in Non-Stationary Environments.
- PyTorch >= 1.12.1 (with suitable CUDA and CuDNN version)
- torchvision >= 0.10.0
- torchmeta >= 1.8.0
- Python3
- Numpy
- pandas
Rotated Gaussian and Rotated MNIST: https://drive.google.com/file/d/1o80mLQcMHej9d-MznWjGp48QRBCyWTX9/view?usp=sharing
Rotated Gaussian experiment
python scripts/train.py --data_dir=../dataset --gpu 0 --algorithm DDA --dataset EDGEvolCircle --test_env 29 --steps 5001 --hparams "{\"batch_size\":120}"
Rotated MNIST experiment
python scripts/train.py --data_dir=../dataset --gpu 0 --algorithm DDA --dataset EDGRotatedMNIST --test_env 8 --steps 5001 --hparams "{\"env_number\":9}"
This code is implemented based on the domainbed code.
If you use this code for your research, please consider citing:
@article{zeng2023foresee,
title={Foresee What You Will Learn: Data Augmentation for Domain Generalization in Non-Stationary Environments},
author={Zeng, Qiuhao and Wang, Wei and Zhou, Fan and Ling, Charles and Wang, Boyu},
journal={arXiv preprint arXiv:2301.07845},
year={2023}
}