Skip to content

vmmm123/ConSL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages