This is the PyTorch implementation of our paper:
Building Socially-Equitable Public Models
Yejia Liu, Jianyi Yang, Pengfei Li, Tongxin Li, Shaolei Ren
The Forty-first International Conference on Machine Learning (ICML 2024)
- Create and activate a local conda environment:
conda create --name <env_name> python=3.7
conda activate <env_name>
- Install PyTorch following the instructions on https://pytorch.org/ (we used PyTorch 1.5.1 in our experiments). For example,
conda install pytorch==1.5.1 torchvision==0.6.1 -c pytorch
- Clone the repository and enter its root directory:
git clone https://github.com/Ren-Research/Socially-Equitable-Public-Models.git
cd Socially-Equitable-Public-Models
- Install required packages and dependencies in
requirement.txt
:
conda install --file requirements.txt
- Download data following this guide
For reproducibility, we release our trained public models here.
To run these trained models, please use the script run_public_models.sh:
sh run_public_models.sh
- For the Data Center Workload application, here are example training commands:
# Train an equitable model with different lambda, similar groups
python main_dc_workload.py --training --lr 0.05 --n_epochs 50 --batch_size 128 --diff_lambda --q_idx 1.5
# Train an equitable model with same lambda, similar groups
python main_dc_workload.py --training --lr 0.05 --n_epochs 50 --batch_size 128 --q_idx 1.1
# Train a baseline model with different lambda, different groups
python main_dc_workload.py --training --lr 0.05 --n_epochs 100 --batch_size 128 --diff_lambda --baseline --diff_group_dist
- For the EV Charging application, here are example training commands:
# Train an equitable model with similar groups
python -m pdb main_ev_charging.py --training --lr 1e-4 --n_epochs 50 --batch_size 128 --q_idx 30
# Train a baseline model with different groups
python -m pdb main_ev_charging.py --training --lr 1e-4 --n_epochs 100 --batch_size 128 --diff_group_dist
We provide the code for our paper plots in the following Jupyter python notebooks:
@article{SociallyEquitablePUblicModel_ICML_2024,
title = {Building Socially-Equitable Public Models},
author = {Liu, Yejia and Yang, Jianyi and Li, Pengfei and Li, Tongxin and Ren, Shaolei},
journal = {ICML},
year = {2024}
}