Coder Social home page Coder Social logo

tradeoff-invariant-representation-learning's Introduction

On Characterizing the Trade-off in Invariant Representation Learning

By Bashir Sadeghi, Sepehr Dehdashtian, and Vishnu Naresh Boddeti

Introduction

plot

This code archive includes the Python implementation of "On Characterizing the Trade-off in Invariant Representation Learning" and corresponding baseline methods. We model the encoder via r functions in a universal reproducing kernel Hilbert spaces, where r is the embedding dimensionality. Denoted by K-T-Opt, our method aims to maximize the dependency between the representation Z and the target attribute Y while keeping the dependency between Z and the semantic attribute S as small as possible. Suppose the statistical dependence between Y and S is not negligible. In that case, there will be a trade-off between the utility of the downstream target task and invariance to S, as shown in the following diagram.

plot

Citation

If you think this work is useful to your research, please cite:

@inproceedings{sadeghi2022tradeoff,
  title={On Characterizing the Trade-off in Invariant Representation Learning},
  author={Sadeghi, Bashir and Dehdashtian, Sepehr and Boddeti, Vishnu},
  booktitle={Transactions on Machine Learning Research},
  year={2022}
}

Link to the paper: https://hal.cse.msu.edu/papers/characterizing-trade-off-invariant-representation-learning/

Setup

First, clone the repository by calling the following command:

git clone https://github.com/human-analysis/tradeoff-invariant-representation-learning.git

Download data (about 1GB) used in the paper:

cd tradeoff-invariant-representation-learning
wget http://hal.cse.msu.edu/assets/data/papers/2022-tmlr-tradeoff-invariant-representation-learning.zip
unzip 2022-tmlr-tradeoff-invariant-representation-learning.zip
rm -rf 2022-tmlr-tradeoff-invariant-representation-learning.zip

Requirements

  1. python 3.8.5
  2. pyTorch 1.10.0
  3. pytorch-lightning 1.4.5
  4. wget
  5. Check requirements.yml for detailed dependencies. To install the dependencies completely in a new conda environment, you can run conda env create -f requirements.yml command.

Commands to Reproduce Results in Paper

Set the trade-off parameter tau between zero and one, where tau equal to zero correspond to standard representation learning with no invariance constraint and tau approaching one corresponds to exact invariance. In the the following commands we let tau=0.5.

Toy Gaussian Dataset

plot

Our K-T_Opt approach
python main_gaussian.py --args exps/gaussian/args_gaussian_kernel.txt --tau=0.5
SARL baseline
python main_gaussian.py --args exps/gaussian/args_gaussian_linear.txt --tau=0.5
ARL baseline
python main_gaussian.py --args exps/gaussian/args_gaussian_arl.txt --tau=0.5
HSIC-IRepL baseline
python main_gaussian.py --args exps/gaussian/args_gaussian_hsic.txt --tau=0.5

CelebA Dataset

plot

Our K-T_Opt approach
python main.py --args exps/celeba/args_celeba_kernel.txt --tau=0.5
SARL baseline
python main.py --args exps/celeba/args_celeba_linear.txt --tau=0.5
ARL baseleine
python main.py --args exps/celeba/args_celeba_arl.txt --tau=0.5
HSIC-IRepL baseleine
python main.py --args exps/celeba/args_celeba_hsic.txt --tau=0.5

2018-WA Census Data

plot

Our K-T_Opt approach
python main_withdataloader.py --args exps/folktables/args_folk_kernel.txt --tau=0.5
SARL baseline
python main_withdataloader.py --args exps/folktables/args_folk_linear.txt --tau=0.5
ARL baseleine
python main.py --args exps/folktables/args_folk_arl.txt --tau=0.5
HSIC-IRepL baseleine
python main.py --args exps/folktables/args_folk_hsic.txt --tau=0.5

2018-NY Census Data

plot plot

Our K-T_Opt approach
python main_withdataloader.py --args exps/folktables-4class/args_folk4c_kernel.txt --tau=0.5
SARL baseline
python main_withdataloader.py --args exps/folktables-4class/args_folk4c_linear.txt --tau=0.5
ARL baseleine
python main.py --args exps/folktables-4class/args_folk4c_arl.txt --tau=0.5
HSIC-IRepL baseleine
python main.py --args exps/folktables-4class/args_folk4c_hsic.txt --tau=0.5

Effect of Semantic Attribute (Age) Removal on 2018-WA Census Dataset

plot plot

tradeoff-invariant-representation-learning's People

Contributors

bashir-sadeghi avatar vboddeti avatar

Watchers

 avatar  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.