Official pytorch implementation of "SLIDE: A surrogate fairness constraint to ensure fairness consistency" published in Neural Networks (Volume 154, 2022, Pages 441-454) by Kunwoong Kim, Ilsang Ohn, Sara Kim, and Yongdai Kim.
-
Locate your custom_dataset in the directory "datasets/{custom_dataset}".
-
Add loading function in "load.data_py" that should returns a tuple
(xs, x, y, s)
consisting fourtorch.tensor
wherexs = torch.cat([x, s.reshape(s.size(0), 1)], dim=1).
-
run SLIDE as the command: "python main.py --dataset {custom_dataset} --lmda {lmda}" where lmda is the fairness hyper-parameter, higher lmda increases the level of fairness (demographic parity or disparate impact).
For example, you can command
python main.py --dataset law --lmda 5.0
These codes are based on the following environments and versions of the corresponding libraries.
python >= 3.6 torch >= 1.8.0