Code Monkey home page Code Monkey logo

c-mixup's Introduction

C-Mixup: Improving Generalization in Regression

Official code of C-Mixup.

If you find this repository useful in your research, please cite the following paper:

@inproceedings{yao2022cmix,
  title={C-Mixup: Improving Generalization in Regression},
  author={Yao, Huaxiu and Wang, Yiping and Zhang, Linjun and Zou, James and Finn, Chelsea},
  booktitle={Proceeding of the Thirty-Sixth Conference on Neural Information Processing Systems},
  year={2022}
}

Prerequisites

  • python 3.7.13
  • matplotlib 3.3.4
  • numpy 1.20.1
  • pandas 1.2.3
  • pillow 9.0.1
  • pytorch 1.11.0
  • pytorch_transformers 1.2.0
  • torchvision 0.9.0
  • wilds 2.0.0

Datasets and Scripts

We put all code except Echo and PovertyMap on the src folder. Echo and PovertyMap datasets are built upon different codebase, which are put in the echo and povertymap folders, respectively.

Airfoil

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on Airfoil is:

python main.py --dataset Airfoil --mixtype kde --kde_bandwidth 1.75 --use_manifold 1 --store_model 1 --read_best_model 0

NO2

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on NO2 is:

python main.py --dataset NO2 --mixtype kde --kde_bandwidth 1.2 --use_manifold 0 --store_model 1 --read_best_model 0

Exchange_rate

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on Exchange_rate is:

python main.py --dataset TimeSeries --data_dir ./data/exchange_rate/exchange_rate.txt --ts_name exchange_rate --mixtype kde --kde_bandwidth 5e-2 --use_manifold 1 --store_model 1 --read_best_model 0

Electricity

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on Electricity is:

python main.py --dataset TimeSeries --data_dir ./data/electricity/electricity.txt --ts_name electricity --mixtype kde --kde_bandwidth 0.5 --use_manifold 0 --store_model 1 --read_best_model 0

RCF-MNIST

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on RCF-MNIST is:

python main.py --dataset RCF_MNIST --data_dir ./data/RCF_MNIST --mixtype random --batch_type 1 --kde_bandwidth 0.2 --use_manifold 1 --store_model 1 --read_best_model 0

Crime

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on Crime is:

python main.py --dataset CommunitiesAndCrime --mixtype kde --kde_bandwidth 4.0 --use_manifold 1 --store_model 1 --read_best_model 0

Skillcraft

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on Skillcraft is:

python main.py --dataset SkillCraft --mixtype kde --kde_bandwidth 1.0 --use_manifold 0 --store_model 1 --read_best_model 0

DTI

This dataset can be downloaded via the link in the Google Drive. Please put the corresponding datafolder to src/data

The command to run C-Mixup on DTI is:

python main.py --dataset Dti_dg --data_dir ./data/dti --mixtype kde --kde_bandwidth 20.0 --use_manifold 1 --store_model 1 --read_best_model 0

PovertyMap

To get detailed information of the datasets, please refer to Appendix E of the paper or original paper.

This code is built upon LISA and Wilds.

Before running, please cd PovertyMap

The datasets will be automatically downloaded when running the scripts provided below.

python main.py --dataset poverty --algorithm mixup --data-dir ../../datasets/ --experiment_dir .. --is_kde 1 --kde_bandwidth 0.5

EchoNet

To get detailed information of the datasets, please refer to the website.

This code is built upon EchoNet.

Before running, please cd EchoNet.

You need to follow the guideline from the website and download the dataset into ../../EchoNet-Dynamic/ directory first.

For the preparation you need to install the echonet environment and complete segmentation tasks by running the commands:

pip install --upgrade --user . 
python echonet/__main__.py segmentation --save_video

The command to run C-Mixup on EchoNet is:

echonet video --batch_size 10 --device cuda --num_workers 0 --num_epochs 20 --mixtype kde --bandwidth 50.0 --run_test True

c-mixup's People

Contributors

ypwang61 avatar huaxiuyao avatar

Stargazers

 avatar  avatar  avatar zeo avatar xiaomu avatar Egqawkq avatar Bard avatar Koma avatar  avatar  avatar S22 avatar zane.zang avatar  avatar  avatar Martin Ferianc avatar  avatar  avatar  avatar  avatar dqliu avatar Jianing Zhu avatar Haruki09 avatar  avatar Andrew Chan avatar Thibault Laugel avatar Xiao Gu avatar David Shumway avatar  avatar  avatar XIN XIE avatar DY avatar Qin Lin avatar Gerasimov Maxim avatar Mirrork avatar cheng avatar Jacob A Rose avatar Jiacheng Zhu avatar Farhang avatar MangoCat avatar Jeff Carpenter avatar Salva Rühling Cachay avatar Siddharth Shrivastava avatar YJ Zhang avatar Jiequan avatar Jie-Ying Li avatar Edward Nguyen avatar  avatar Kokyou avatar ss avatar yanqiangmiffy avatar  avatar Linwei Sang avatar Sangdoo Yun avatar Raja Biswas avatar Xiang Pan (潘翔) avatar  avatar Zhihua Liu avatar Kinke Kabingila avatar Bharath avatar  avatar

Watchers

Ryadh Khsib avatar  avatar  avatar

c-mixup's Issues

Reproduce the results

Hi,

Thanks for your impressive work, but I can not reproduce the results in your paper with your source codes on some datasets, like Crime, Skillcraft, and so on. What I have done is just repeat the experiments with the provided parameters on seed 0,1,2. Since you have 3 runs on each dataset, could you provide the seed numbers and the parameters on each seed?

Thank you very much and look forward to your reply.

I have a question.

Hello.
First of all, thank you for source.

Is there a reason why scheduler.step() is missing in the train() function of algorithm.py when "is_mixup" is True?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.