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
# preprocess Places

# generate SceceCOCO dataset

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:


View Github