Skip to content

Commit

Permalink
Merge pull request #26 from ChrisMRuss/workflow
Browse files Browse the repository at this point in the history
pypi installer
  • Loading branch information
ChrisMRuss authored Jun 19, 2024
2 parents 009ad55 + aa1088a commit 2530c5b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ OxonFair is an expressive toolkit designed to enforce a wide-range of fairness d
The toolkit is designed to overcome a range of shortcomings in existing fairness toolkits for high-capacity models that overfit to the training data.
It is designed and works for computer vision and NLP problems alongside tabular data.

For low-capacity models (, linear regression over a small number of variables, and decision-trees of limited depth), we recommend [fairlearn](https://github.com/fairlearn/fairlearn).
For low-capacity models (e.g., logistic regression over a small number of variables, and decision-trees of limited depth), we recommend [fairlearn](https://github.com/fairlearn/fairlearn).

We support a range of complex classifiers including [pytorch](https://pytorch.org/), [scikit learn](https://scikit-learn.org/stable/), and ensembles provided by [autogluon](https://auto.gluon.ai/stable/index.html).

It is a modified version of [autogluon.fair](https://github.com/autogluon/autogluon-fair) and actively maintained.
OxonFair is a modified version of [autogluon.fair](https://github.com/autogluon/autogluon-fair) and actively maintained.

## Source install

Expand Down
22 changes: 10 additions & 12 deletions examples/training_a_two_head_model/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
## Setup for Training a Two-Head Model
# Setup for Training a Two-Head Model

1) Download img_align_celeba.zip and list_attr_celeba.txt from http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
and move it to data/celeba/.
This directory contains files for training a two-headed model on the celbA dataset.

2) Create a virtual environment with python=3.8, and activate it.
1) Download img_align_celeba.zip and list_attr_celeba.txt from <http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html>
and move it to data/celeba/ inside this directory.

3) Install your torch and torchvision. We used torch==1.12.1+cu116 and torchvision==0.13.1+cu116.
2) Create a virtual environment with python=3.8, and activate it.

````commandline
pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
````
3) Install torch and torchvision. We used torch==1.12.1+cu116 and torchvision==0.13.1+cu116.

pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

4) Install other minimal requirements.
````

python -m pip install -r requirements.txt
````

5) Run the python script.
````

python two_head_model_demo.py --target_class 9 --protected_class 20
1 change: 0 additions & 1 deletion examples/training_a_two_head_model/two_head_model_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,3 @@ def validation_step(self, batch, batch_idx):
loaded_model = LitTwoHead.load_from_checkpoint(checkpoint_path=checkpoint_callback.best_model_path, model=model)
loaded_model.eval()
trainer.test(model=loaded_model, dataloaders=test_loader)

11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["setuptools>=68.2.2"]
build-backend = "setuptools.build_meta"

[project]
name = "oxonfair"
dynamic = ["optional-dependencies",'license','classifiers','version','authors','dependencies','readme','description','requires-python']

[project.urls]
Homepage = "https://github.com/ChrisMRuss/oxon-fair/"
Issues = "https://github.com/ChrisMRuss/oxon-fair/issues"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def default_setup_args(*, version):
license="Apache-2.0",
license_files=("LICENSE", "NOTICE"),
# Package info
packages=find_packages("src"),
package_dir={"": "src"},
packages=find_packages("src"),
namespace_packages=[],
zip_safe=True,
include_package_data=True,
Expand Down

0 comments on commit 2530c5b

Please sign in to comment.