Git Product home page Git Product logo

fedoracy / causal-semantic-generative-model Goto Github PK

View Code? Open in Web Editor NEW

This project forked from changliu00/causal-semantic-generative-model

0.0 0.0 0.0 195 KB

Codes for Causal Semantic Generative model (CSG), the model proposed in "Learning Causal Semantic Representation for Out-of-Distribution Prediction" (NeurIPS-21)

Home Page: https://arxiv.org/abs/2011.01681

License: MIT License

Python 87.38% Shell 8.42% Jupyter Notebook 4.19%

causal-semantic-generative-model's Introduction

Learning Causal Semantic Representation for Out-of-Distribution Prediction

This repository is the official implementation of "Learning Causal Semantic Representation for Out-of-Distribution Prediction" (NeurIPS 2021).

Chang Liu <[email protected]>, Xinwei Sun, Jindong Wang, Haoyue Tang, Tao Li, Tao Qin, Wei Chen, Tie-Yan Liu.
[Paper & Appendix] [Slides] [Video] [Poster]

Introduction

graphical summary

The work proposes a Causal Semantic Generative model (CSG) for OOD generalization (single-source domain generalization) and domain adaptation. The model is developed following a causal reasoning process, and prediction is made by leveraging the causal invariance principle. Training and prediction algorithms are developed based on variational Bayes with a novel design. Theoretical guarantees on the identifiability of the causal factor and the benefits for OOD prediction are presented.

This codebase implements the CSG methods, and implements or integrates various baselines. Most domain adaptation baselines (except BNM) use the dalib package. The experiment setups on the PACS and VLCS datasets are adopted from the domainbed repository. Authorships are clarified in each file or module.

Requirements

The code requires python version >= 3.6, and is based on PyTorch. To install requirements:

pip install -r requirements.txt

Usage

Folder a-mnist contains scripts to run the experiments on the Shifted-MNIST dataset, and a-imageclef on the ImageCLEF-DA dataset, and a-domainbed on the PACS and VLCS datasets (the prefix a- represents "application").

Go to the respective folder and run the prepare_data.sh or makedata.sh script there to prepare the datasets. Run the run_ood.sh (for OOD generalization methods) and run_da.sh (for domain adaptation methods) scripts to train the models. Evaluation result (accuracy on the test domain) is printed and written to disk with the model and configurations. See the commands in the script files or python3 main.py --help for customized usage or hyperparameter tuning.

causal-semantic-generative-model's People

Contributors

changliu00 avatar

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.