This repository is the official implementation of STDW.
TL;DR: The paper introduces a dynamic self-training method for gradual domain adaptation that effectively transfers knowledge across domains.
conda create -n torch python=3.9
conda activate torch
conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=12.1 -c pytorch -c nvidia
conda install tqdm matplotlib pandas scikit-learn
pip install POT # for GOATData set placement:
- Download the Portraits dataset from here and put pictures in the
data/portraits/F/anddata/portraits/M/folders. - Download the Covertype dataset from here and place it in
data/covertype/covertype.data.gz. - MNIST will be automatically downloaded by the code.
Optional: Pre-train source domain classifiers to ensure reproducibility
python pre_train.py --gpu_ids 0 # Pre-train the classifier on the source domainTrain the model by running commands like the following:
python main_stdw.py --dataset mnist --gpu_ids 0 # Run the GOAT model
python main_gan.py --dataset mnist --gpu_ids 0 # Run the FlowGTA modelIf you plan to modify or extend our method, we highly recommend using the project FlowLine: Automated tool for running Python programs in a streamlined manner for all testing.
We thank the authors of the GOAT official.