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
Hashes for tensorflow_model_remediation-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2253b0503d0d44967b1d8d3fa8d0ac1614d66d9b12cfdd0f4fbda9ecefe560d |
|
MD5 | 7eaf131d5e901c3abea1c7bfa474db1c |
|
BLAKE2b-256 | ce73edcc96cc08aa0e1b2b5a09e7f897f2dc398618ad10973d58e5daf1592344 |
Hashes for tensorflow_model_remediation-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ab245793f80eaa03c0db788762227fd7a564548216756a744922c43e3cd664e |
|
MD5 | 43745b044cd415d2e35cf7de4189c60c |
|
BLAKE2b-256 | 9c4d3a6bb4dc3112a9e8cc761662143c27db9093f708b923245fa7e87bf3a9da |