Transfer Risk Minimization (TRM)

Code for Learning Representations that Support Robust Transfer of Predictors, Yilun Xu, Tommi Jaakkola

Prepare the Datasets

Preprocess the SceneCOCO dataset :

# preprocess COCO
python coco.py
# preprocess Places
python places.py

# generate SceceCOCO dataset
python cocoplaces.py

Running the Experiments

  • Datasets:

    • Synthetic datasets for controlled experiments: ColorMNIST / SceneCOCO

    • Real-world datasets: PACS / Office-Home

python -m domainbed.scripts.train  --data_dir {root} --algorithm {alg} \
	--dataset {dataset} --trial_seed {t_seed} --epochs {epochs}  (--resnet50)

root: root directory for the data
alg: ERM, VREx, IRM, GroupDRO, Fish, MLDG, TRM
t_seed: seed for data splitting
dataset: PACS or OfficeHome or ColoredMNIST or SceneCOCO
resnet50: use ResNet50 (default: ResNet18)
epochs: training epochs

This implementation is based on / inspired by:

GitHub

View Github