Skip to content
/ MLDG Public

The demo code for the MLDG paper "Learning to Generalize: Meta-Learning for Domain Generalization", https://arxiv.org/abs/1710.03463, https://arxiv.org/pdf/1710.03463.pdf

License

Notifications You must be signed in to change notification settings

HAHA-DL/MLDG

Repository files navigation

MLDG

This is a code sample for the paper "Learning to Generalize: Meta-Learning for Domain Generalization" https://arxiv.org/pdf/1710.03463.pdf

This code is the MLP version of MLDG with one-hidden layer, whose inputs are the features extracted for PACS. The baseline is the one for the sanity check without the meta-train and meta-val losses.

Requirements

Python 2.7

Pytorch 0.3.1

Run the baseline

Please download the data first, the data is the deep features extracted from ImageNet pretrained ResNet18, then

sh run_baseline.sh 'data_root/' # data_root is the folder path where you download your data to.

Run the MLDG

sh run_mldg.sh 'data_root/'

Bibtex

 @inproceedings{Li2018MLDG,
   title={Learning to Generalize: Meta-Learning for Domain Generalization},
   author={Li, Da and Yang, Yongxin and Song, Yi-Zhe and Hospedales, Timothy},
  	booktitle={AAAI Conference on Artificial Intelligence},
  	year={2018}
 }

Your own data

Please tune the 'meta_step_size' and 'meta_val_beta' for your own data, this parameter is related to 'alpha' and 'beta' in paper which should be tuned for different cases.

About

The demo code for the MLDG paper "Learning to Generalize: Meta-Learning for Domain Generalization", https://arxiv.org/abs/1710.03463, https://arxiv.org/pdf/1710.03463.pdf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published