Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.33 KB

README.md

File metadata and controls

31 lines (25 loc) · 1.33 KB

Contrastive Supervised Learning on Domain Generalization and Application to Data Corruption

This is the pytorch implementation of the paper "Contrastive Supervised Learning on Domain Generalization and Application to Data Corruption".

Requirements

  • A Python install version 3.7
  • A PyTorch and torchvision installation version 1.7.0 and 0.8.1, respectively.

SETUP

Running experiments

Multiple Domain Generalization

You can train the model from scratch :

  • cd MDG
  • python main.py --data_dir ./data_dir --model AlexNet --datasets PACS
    • data_dir: the dataset directory
    • model: AlexNet or ResNet18
    • datasets: PACS or OfficeHome

Single Domain Generalization

You can train the model from scratch :

  • cd SDG
  • python main.py --data_dir ./cifar10_dir --target_dir ./cifar10C_dir --file_name acc.csv
    • data_dir: the dataset directory for cifar10
    • target_dir: the dataset directory for cifar10-C
    • file_name: the name of file storing the test accuracy