Skip to content
/ CID Public

PyTorch implementation of our paper "Revisiting Contrastive Learning in Out-of-Distribution Generalization"

License

Notifications You must be signed in to change notification settings

GA-17a/CID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Revisiting Contrastive Learning in Out-of-Distribution Generalization

Introduction

This is a PyTorch implementation of our paper Revisiting Contrastive Learning in Out-of-Distribution Generalization.

framework

Correlation Shift

cd correlation_shift

# ERM
sh ERM.sh

# IRM
sh IRM.sh

# Ours, require GPU memory > 24G
sh IRM_CID.sh

Diversity Shift

Dataset Preparation

Download the PACS dataset from: download_pacs.

Update the "--image_path" in /diversity_shift/ERM_CID.sh according to your path.

Run

cd diversity_shift

sh ERM_CID.sh

Reference

Our implementation references the codes in the following repositories:

About

PyTorch implementation of our paper "Revisiting Contrastive Learning in Out-of-Distribution Generalization"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published