Giter Site home page Giter Site logo

fairness-shift's Introduction

This directory is for simulating the proposed pre-processing approach on the 
synthetic dataset. The program needs PyTorch, CVXPY, Jupyter Notebook, and CUDA.

The directory contains a total of 5 files and 1 child directory: 
1 README, 3 python files, 1 jupyter notebook, 
and the child directory containing 6 numpy files for synthetic data.
The synthetic data contains training set and test set.
----------------------------------------------------------------------
To simulate the algorithm, please use the jupyter notebook in the directory.
----------------------------------------------------------------------
The jupyter notebook will load the data and train the models.
We consider two scenarios: supporting (1) a single metric (DP) and (2) multiple metrics (DP & EO).

Each training shows either in-processing-only baseline or our framework 
(i.e., pre- + in-processing). Note that we use FairBatch [Roh et al., ICLR 2021] 
as the in-processing baseline that adaptively adjusts batch ratios for fairness.
When using our pre-processing, we utilize a SDP solver to find the new data ratio. 
The solver is defined in our program.
Experiments are repeated 5 times each.
After the training, the test accuracy and fairness will be shown.

The two python files are models.py, utils.py, and FairBatchSampler_Multiple.py.
The models.py contains a logistic regression architecture.
The utils.py contains a total of three functions for 
finding example weight, sampling data, and testing the model performances.
The FairBatchSampler_Multiple.py contains two classes: CustomDataset and FairBatch. 
CustomDataset class defines the dataset, and FairBatch class implements the state-of-the-art 
in-processing technique [Roh et al., ICLR 2021] that adjusts batch ratios for fairness.

The detailed explanations about each component have been written 
in the codes as comments.
Thanks!

fairness-shift's People

Contributors

anshuman23 avatar

Watchers

 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.