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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1620e7c6263214575580bc02b980387809ea775bf76e1dd08b66d26fa1a96f5e |
|
MD5 | 0a8651d26ffcfeb044ec2eb5bccb30c9 |
|
BLAKE2b-256 | 5b86809311d0fa25b32e316f08a3452e88650569c8c8ff2c55d5c622471765a2 |
Hashes for tensorflow_model_remediation-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80bbddac441a78d2f8dabdbe11a568ea3cccd19403c3afc39754202343611396 |
|
MD5 | a32c11d71be374b1830a7d3a1e24c097 |
|
BLAKE2b-256 | 2c13573291de89af973e8d511c3226d3a2bd95e1d3c93a35f1fe8a0b6331db65 |