TensorFlow Model Remediation
Project description
TensorFlow Model Remediation
TensorFlow Model Remediation is a library that provides solutions for machine learning practitioners working to create and train models in a way that reduces or eliminates user harm resulting from underlying performance biases.
Installation
You can install the package from pip
:
$ pip install tensorflow-model-remediation
Note: Make sure you are using TensorFlow 2.x.
Documentation
This library will ultimately contain a collection of techniques for addressing a wide range of concerns. For now it contains a single technique, MinDiff, which can help reduce performance gaps between example subgroups.
We recommend starting with the overview guide or trying it interactively in our tutorial notebook.
from tensorflow_model_remediation import min_diff
import tensorflow as tf
# Start by defining a Keras model.
original_model = ...
# Set the MinDiff weight and choose a loss.
min_diff_loss = min_diff.losses.MMDLoss()
min_diff_weight = 1.0 # Hyperparamater to be tuned.
# Create a MinDiff model.
min_diff_model = min_diff.keras.MinDiffModel(
original_model, min_diff_loss, min_diff_weight)
# Compile the MinDiff model as you normally would do with the original model.
min_diff_model.compile(...)
# Create a MinDiff Dataset and train the min_diff_model on it.
min_diff_model.fit(min_diff_dataset, ...)
Disclaimers
If you're interested in learning more about responsible AI practices, including fairness, please see Google AI's Responsible AI Practices.
tensorflow/model_remediation
is Apache 2.0 licensed. See the
LICENSE
file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tensorflow_model_remediation-0.1.0.tar.gz
.
File metadata
- Download URL: tensorflow_model_remediation-0.1.0.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5626543da0c6bc3b06b9a27a8a7ea4b996df63e81779adaa49d6f3fd414dde03 |
|
MD5 | e35619704db98708408de73c9718363e |
|
BLAKE2b-256 | fabea5cf134aea70daffc4a225d5ede19d34d05f9b5b3bfccad47c9e1ca9cc0e |
File details
Details for the file tensorflow_model_remediation-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: tensorflow_model_remediation-0.1.0-py3-none-any.whl
- Upload date:
- Size: 57.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 138494430b16d66d1f5b0aaa4dbe3eed07c6c14fb1ac1661c2bafed64a909242 |
|
MD5 | 829380cb4228d83685b5b52638b1e97c |
|
BLAKE2b-256 | 6e14c3065e3be4bd2fcb5307ed0c2d6f3534cdd603ae156a1dee3166fb441365 |