Skip to main content

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.

PyPI version Tutorial Overview

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensorflow_model_remediation-0.1.3.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file tensorflow_model_remediation-0.1.3.tar.gz.

File metadata

  • Download URL: tensorflow_model_remediation-0.1.3.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.7

File hashes

Hashes for tensorflow_model_remediation-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5392385500e2be1c985b13fef0a91f2f988546b1fa313607dbbc081c7259131e
MD5 ee3b9a7ea646cebb14cb4b776e29814a
BLAKE2b-256 b43ea3e8ffce7e608c0c316b72b573efd0f34b8a0d61b4ffccaa2008019b1f18

See more details on using hashes here.

File details

Details for the file tensorflow_model_remediation-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tensorflow_model_remediation-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 69.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.7

File hashes

Hashes for tensorflow_model_remediation-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8ea649ce26c81fddfe3e716657bfa50fa51cf792544018d1a10f513dacd7c224
MD5 dfb35418421fb5eb5d3f74d085ed3d2f
BLAKE2b-256 93e5cb5e3148d44305ea9781b7df0cc663da57b5ccb9dc12c1d1d615fe2c11b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page