• Stars
    star
    1,690
  • Rank 27,610 (Top 0.6 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons

⚠️ ⚠️ ⚠️

TensorFlow Addons (TFA) has ended development and introduction of new features.

TFA has entered a minimal maintenance and release mode until a planned end of life in May 2024. Please modify downstream libraries to take dependencies from other repositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP)

For more information see: #2807





PyPI Status Badge PyPI - Python Version Documentation Gitter chat Code style: black

Continuous Build Status

Build Status
Ubuntu/macOS/Windows Status
Ubuntu GPU custom ops Status

TensorFlow Addons is a repository of contributions that conform to well-established API patterns, but implement new functionality not available in core TensorFlow. TensorFlow natively supports a large number of operators, layers, metrics, losses, and optimizers. However, in a fast moving field like ML, there are many interesting new developments that cannot be integrated into core TensorFlow (because their broad applicability is not yet clear, or it is mostly used by a smaller subset of the community).

Addons Subpackages

Maintainership

The maintainers of TensorFlow Addons can be found in the CODEOWNERS file of the repo. This file is parsed and pull requests will automatically tag the owners using a bot. If you would like to maintain something, please feel free to submit a PR. We encourage multiple owners for all submodules.

Installation

Stable Builds

TensorFlow Addons is available on PyPI for Linux, macOS, and Windows. To install the latest version, run the following:

pip install tensorflow-addons

To ensure you have a version of TensorFlow that is compatible with TensorFlow Addons, you can specify the tensorflow extra requirement during install:

pip install tensorflow-addons[tensorflow]

Similar extras exist for the tensorflow-gpu and tensorflow-cpu packages.

To use TensorFlow Addons:

import tensorflow as tf
import tensorflow_addons as tfa

Python Op Compatility

TensorFlow Addons is actively working towards forward compatibility with TensorFlow 2.x. However, there are still a few private API uses within the repository so at the moment we can only guarantee compatibility with the TensorFlow versions which it was tested against. Warnings will be emitted when importing tensorflow_addons if your TensorFlow version does not match what it was tested against.

Python Op Compatibility Matrix

TensorFlow Addons TensorFlow Python
tfa-nightly 2.10, 2.11, 2.12 3.8, 3.9, 3.10, 3.11
tensorflow-addons-0.20.0 2.10, 2.11, 2.12 3.8, 3.9, 3.10, 3.11
tensorflow-addons-0.19.0 2.9, 2.10, 2.11 3.7, 3.8, 3.9, 3.10
tensorflow-addons-0.18.0 2.8, 2.9, 2.10 3.7, 3.8, 3.9, 3.10
tensorflow-addons-0.17.1 2.7, 2.8, 2.9 3.7, 3.8, 3.9, 3.10
tensorflow-addons-0.16.1 2.6, 2.7, 2.8 3.7, 3.8, 3.9, 3.10
tensorflow-addons-0.15.0 2.5, 2.6, 2.7 3.7, 3.8, 3.9
tensorflow-addons-0.14.0 2.4, 2.5, 2.6 3.6, 3.7, 3.8, 3.9
tensorflow-addons-0.13.0 2.3, 2.4, 2.5 3.6, 3.7, 3.8, 3.9
tensorflow-addons-0.12.1 2.3, 2.4 3.6, 3.7, 3.8
tensorflow-addons-0.11.2 2.2, 2.3 3.5, 3.6, 3.7, 3.8
tensorflow-addons-0.10.0 2.2 3.5, 3.6, 3.7, 3.8
tensorflow-addons-0.9.1 2.1, 2.2 3.5, 3.6, 3.7
tensorflow-addons-0.8.3 2.1 3.5, 3.6, 3.7
tensorflow-addons-0.7.1 2.1 2.7, 3.5, 3.6, 3.7
tensorflow-addons-0.6.0 2.0 2.7, 3.5, 3.6, 3.7

C++ Custom Op Compatibility

TensorFlow C++ APIs are not stable and thus we can only guarantee compatibility with the version TensorFlow Addons was built against. It is possible custom ops will work with multiple versions of TensorFlow, but there is also a chance for segmentation faults or other problematic crashes. Warnings will be emitted when loading a custom op if your TensorFlow version does not match what it was built against.

Additionally, custom ops registration does not have a stable ABI interface so it is required that users have a compatible installation of TensorFlow even if the versions match what we had built against. A simplification of this is that TensorFlow Addons custom ops will work with pip-installed TensorFlow but will have issues when TensorFlow is compiled differently. A typical example of this would be conda-installed TensorFlow. RFC #133 aims to fix this.

C++ Custom Op Compatibility Matrix

TensorFlow Addons TensorFlow Compiler cuDNN CUDA
tfa-nightly 2.12 GCC 9.3.1 8.6 11.8
tensorflow-addons-0.20.0 2.12 GCC 9.3.1 8.6 11.8
tensorflow-addons-0.19.0 2.11 GCC 9.3.1 8.1 11.2
tensorflow-addons-0.18.0 2.10 GCC 9.3.1 8.1 11.2
tensorflow-addons-0.17.1 2.9 GCC 9.3.1 8.1 11.2
tensorflow-addons-0.16.1 2.8 GCC 7.3.1 8.1 11.2
tensorflow-addons-0.15.0 2.7 GCC 7.3.1 8.1 11.2
tensorflow-addons-0.14.0 2.6 GCC 7.3.1 8.1 11.2
tensorflow-addons-0.13.0 2.5 GCC 7.3.1 8.1 11.2
tensorflow-addons-0.12.1 2.4 GCC 7.3.1 8.0 11.0
tensorflow-addons-0.11.2 2.3 GCC 7.3.1 7.6 10.1
tensorflow-addons-0.10.0 2.2 GCC 7.3.1 7.6 10.1
tensorflow-addons-0.9.1 2.1 GCC 7.3.1 7.6 10.1
tensorflow-addons-0.8.3 2.1 GCC 7.3.1 7.6 10.1
tensorflow-addons-0.7.1 2.1 GCC 7.3.1 7.6 10.1
tensorflow-addons-0.6.0 2.0 GCC 7.3.1 7.4 10.0

Nightly Builds

There are also nightly builds of TensorFlow Addons under the pip package tfa-nightly, which is built against the latest stable version of TensorFlow. Nightly builds include newer features, but may be less stable than the versioned releases. Contrary to what the name implies, nightly builds are not released every night, but at every commit of the master branch. 0.9.0.dev20200306094440 means that the commit time was 2020/03/06 at 09:44:40 Coordinated Universal Time.

pip install tfa-nightly

Installing from Source

You can also install from source. This requires the Bazel build system (version >= 1.0.0).

CPU Custom Ops
git clone https://github.com/tensorflow/addons.git
cd addons

# This script links project with TensorFlow dependency
python3 ./configure.py

bazel build build_pip_pkg
bazel-bin/build_pip_pkg artifacts

pip install artifacts/tensorflow_addons-*.whl
GPU and CPU Custom Ops
git clone https://github.com/tensorflow/addons.git
cd addons

export TF_NEED_CUDA="1"

# Set these if the below defaults are different on your system
export TF_CUDA_VERSION="11"
export TF_CUDNN_VERSION="8"
export CUDA_TOOLKIT_PATH="/usr/local/cuda"
export CUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu"

# This script links project with TensorFlow dependency
python3 ./configure.py

bazel build build_pip_pkg
bazel-bin/build_pip_pkg artifacts

pip install artifacts/tensorflow_addons-*.whl

Tutorials

See docs/tutorials/ for end-to-end examples of various addons.

Core Concepts

Standardized API within Subpackages

User experience and project maintainability are core concepts in TensorFlow Addons. In order to achieve these we require that our additions conform to established API patterns seen in core TensorFlow.

GPU and CPU Custom Ops

TensorFlow Addons supports precompiled custom ops for CPU and GPU. However, GPU custom ops currently only work on Linux distributions. For this reason Windows and macOS will fallback to pure TensorFlow Python implementations whenever possible.

The order of priority on macOS/Windows is:

  1. Pure TensorFlow + Python implementation (works on CPU and GPU)
  2. C++ implementation for CPU

The order of priority on Linux is:

  1. CUDA implementation
  2. C++ implementation
  3. Pure TensorFlow + Python implementation (works on CPU and GPU)

If you want to change the default priority, "C++ and CUDA" VS "pure TensorFlow Python", you can set the environment variable TF_ADDONS_PY_OPS=1 from the command line or run tfa.options.disable_custom_kernel() in your code.

For example, if you are on Linux and you have compatibility problems with the compiled ops, you can give priority to the Python implementations:

From the command line:

export TF_ADDONS_PY_OPS=1

or in your code:

import tensorflow_addons as tfa
tfa.options.disable_custom_kernel()

This variable defaults to True on Windows and macOS, and False on Linux.

Proxy Maintainership

TensorFlow Addons has been designed to compartmentalize submodules so that they can be maintained by community users who have expertise, and a vested interest in that component. We heavily encourage users to submit sign up to maintain a submodule by submitting your username to the CODEOWNERS file.

Full write access will only be granted after substantial contribution has been made in order to limit the number of users with write permission. Contributions can come in the form of issue closings, bug fixes, documentation, new code, or optimizing existing code. Submodule maintainership can be granted with a lower barrier for entry as this will not include write permissions to the repo.

For more information see the RFC on this topic.

Periodic Evaluation of Subpackages

Given the nature of this repository, submodules may become less and less useful to the community as time goes on. In order to keep the repository sustainable, we'll be performing bi-annual reviews of our code to ensure everything still belongs within the repo. Contributing factors to this review will be:

  1. Number of active maintainers
  2. Amount of OSS use
  3. Amount of issues or bugs attributed to the code
  4. If a better solution is now available

Functionality within TensorFlow Addons can be categorized into three groups:

  • Suggested: well-maintained API; use is encouraged.
  • Discouraged: a better alternative is available; the API is kept for historic reasons; or the API requires maintenance and is the waiting period to be deprecated.
  • Deprecated: use at your own risk; subject to be deleted.

The status change between these three groups is: Suggested <-> Discouraged -> Deprecated.

The period between an API being marked as deprecated and being deleted will be 90 days. The rationale being:

  1. In the event that TensorFlow Addons releases monthly, there will be 2-3 releases before an API is deleted. The release notes could give user enough warning.

  2. 90 days gives maintainers ample time to fix their code.

Contributing

TensorFlow Addons is a community-led open source project (only a few maintainers work for Google!). As such, the project depends on public contributions, bug fixes, and documentation. This project adheres to TensorFlow's code of conduct. By participating, you are expected to uphold this code.

Do you want to contribute but are not sure of what? Here are a few suggestions:

  1. Add a new tutorial. Located in docs/tutorials/, these are a great way to familiarize yourself and others with TensorFlow Addons. See the guidelines for more information on how to add examples.
  2. Improve the docstrings. The docstrings are fetched and then displayed in the documentation. Do a change and hundreds of developers will see it and benefit from it. Maintainers are often focused on making APIs, fixing bugs and other code related changes. The documentation will never be loved enough!
  3. Solve an existing issue. These range from low-level software bugs to higher-level design problems. Check out the label help wanted. If you're a new contributor, the label good first issue can be a good place to start.
  4. Review a pull request. So you're not a software engineer but you know a lot about a certain field a research? That's awesome and we need your help! Many people are submitting pull requests to add layers/optimizers/functions taken from recent papers. Since TensorFlow Addons maintainers are not specialized in everything, you can imagine how hard it is to review. It takes very long to read the paper, understand it and check the math in the pull request. If you're specialized, look at the list of pull requests. If there is something from a paper you know, please comment on the pull request to check the math is ok. If you see that everything is good, say it! It will help the maintainers to sleep better at night knowing that he/she wasn't the only person to approve the pull request.
  5. You have an opinion and want to share it? The docs are not very helpful for a function or a class? You tried to open a pull request but you didn't manage to install or test anything and you think it's too complicated? You made a pull request but you didn't find the process good enough and it made no sense to you? Please say it! We want feedback. Maintainers are too much the head into the code to understand what it's like for someone new to open source to come to this project. If you don't understand something, be aware there are no people who are bad at understanding, there are just bad tutorials and bad guides.

Please see contribution guidelines to get started (and remember, if you don't understand something, open an issue, or even make a pull request to improve the guide!).

Community

License

Apache License 2.0

More Repositories

1

tensorflow

An Open Source Machine Learning Framework for Everyone
C++
186,123
star
2

models

Models and examples built with TensorFlow
Python
77,049
star
3

tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
TypeScript
18,430
star
4

tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Python
14,693
star
5

tfjs-models

Pretrained models for TensorFlow.js
TypeScript
14,058
star
6

playground

Play with neural networks!
TypeScript
11,585
star
7

tfjs-core

WebGL-accelerated ML // linear algebra // automatic differentiation for JavaScript.
TypeScript
8,480
star
8

examples

TensorFlow examples
Jupyter Notebook
7,920
star
9

tensorboard

TensorFlow's Visualization Toolkit
TypeScript
6,686
star
10

tfjs-examples

Examples built with TensorFlow.js
JavaScript
6,553
star
11

nmt

TensorFlow Neural Machine Translation Tutorial
Python
6,315
star
12

docs

TensorFlow documentation
Jupyter Notebook
6,119
star
13

swift

Swift for TensorFlow
Jupyter Notebook
6,118
star
14

serving

A flexible, high-performance serving system for machine learning models
C++
6,068
star
15

tpu

Reference models and tools for Cloud TPUs.
Jupyter Notebook
5,214
star
16

rust

Rust language bindings for TensorFlow
Rust
4,939
star
17

lucid

A collection of infrastructure and tools for research in neural network interpretability.
Jupyter Notebook
4,611
star
18

datasets

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
Python
4,298
star
19

probability

Probabilistic reasoning and statistical analysis in TensorFlow
Jupyter Notebook
4,053
star
20

adanet

Fast and flexible AutoML with learning guarantees.
Jupyter Notebook
3,474
star
21

hub

A library for transfer learning by reusing parts of TensorFlow models.
Python
3,467
star
22

minigo

An open-source implementation of the AlphaGoZero algorithm
C++
3,428
star
23

skflow

Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning
Python
3,181
star
24

lingvo

Lingvo
Python
2,812
star
25

agents

TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning.
Python
2,775
star
26

graphics

TensorFlow Graphics: Differentiable Graphics Layers for TensorFlow
Python
2,744
star
27

ranking

Learning to Rank in TensorFlow
Python
2,735
star
28

federated

A framework for implementing federated learning
Python
2,281
star
29

tfx

TFX is an end-to-end platform for deploying production ML pipelines
Python
2,099
star
30

privacy

Library for training machine learning models with privacy for training data
Python
1,916
star
31

tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
C++
1,887
star
32

fold

Deep learning with dynamic computation graphs in TensorFlow
Python
1,824
star
33

recommenders

TensorFlow Recommenders is a library for building recommender system models using TensorFlow.
Python
1,816
star
34

quantum

Hybrid Quantum-Classical Machine Learning in TensorFlow
Python
1,798
star
35

mlir

"Multi-Level Intermediate Representation" Compiler Infrastructure
1,720
star
36

mesh

Mesh TensorFlow: Model Parallelism Made Easier
Python
1,589
star
37

haskell

Haskell bindings for TensorFlow
Haskell
1,558
star
38

model-optimization

A toolkit to optimize ML models for deployment for Keras and TensorFlow, including quantization and pruning.
Python
1,486
star
39

workshops

A few exercises for use at events.
Jupyter Notebook
1,457
star
40

ecosystem

Integration of TensorFlow with other open-source frameworks
Scala
1,370
star
41

gnn

TensorFlow GNN is a library to build Graph Neural Networks on the TensorFlow platform.
Python
1,320
star
42

model-analysis

Model analysis tools for TensorFlow
Python
1,250
star
43

community

Stores documents used by the TensorFlow developer community
C++
1,239
star
44

text

Making text a first-class citizen in TensorFlow.
C++
1,224
star
45

benchmarks

A benchmark framework for Tensorflow
Python
1,144
star
46

tfjs-node

TensorFlow powered JavaScript library for training and deploying ML models on Node.js.
TypeScript
1,048
star
47

similarity

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.
Python
1,008
star
48

transform

Input pipeline framework
Python
984
star
49

neural-structured-learning

Training neural models with structured signals.
Python
982
star
50

gan

Tooling for GANs in TensorFlow
Jupyter Notebook
907
star
51

compression

Data compression in TensorFlow
Python
849
star
52

java

Java bindings for TensorFlow
Java
818
star
53

swift-apis

Swift for TensorFlow Deep Learning Library
Swift
794
star
54

deepmath

Experiments towards neural network theorem proving
C++
779
star
55

data-validation

Library for exploring and validating machine learning data
Python
756
star
56

runtime

A performant and modular runtime for TensorFlow
C++
754
star
57

tensorrt

TensorFlow/TensorRT integration
Jupyter Notebook
736
star
58

docs-l10n

Translations of TensorFlow documentation
Jupyter Notebook
716
star
59

io

Dataset, streaming, and file system extensions maintained by TensorFlow SIG-IO
C++
698
star
60

tfjs-converter

Convert TensorFlow SavedModel and Keras models to TensorFlow.js
TypeScript
697
star
61

decision-forests

A collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models in Keras.
Python
656
star
62

swift-models

Models and examples built with Swift for TensorFlow
Jupyter Notebook
644
star
63

tcav

Code for the TCAV ML interpretability project
Jupyter Notebook
612
star
64

recommenders-addons

Additional utils and helpers to extend TensorFlow when build recommendation systems, contributed and maintained by SIG Recommenders.
Cuda
590
star
65

tfjs-wechat

WeChat Mini-program plugin for TensorFlow.js
TypeScript
547
star
66

flutter-tflite

Dart
534
star
67

lattice

Lattice methods in TensorFlow
Python
519
star
68

model-card-toolkit

A toolkit that streamlines and automates the generation of model cards
Python
415
star
69

mlir-hlo

MLIR
388
star
70

tflite-support

TFLite Support is a toolkit that helps users to develop ML and deploy TFLite models onto mobile / ioT devices.
C++
374
star
71

cloud

The TensorFlow Cloud repository provides APIs that will allow to easily go from debugging and training your Keras and TensorFlow code in a local environment to distributed training in the cloud.
Python
374
star
72

custom-op

Guide for building custom op for TensorFlow
Smarty
373
star
73

tfjs-vis

A set of utilities for in browser visualization with TensorFlow.js
TypeScript
360
star
74

profiler

A profiling and performance analysis tool for TensorFlow
TypeScript
359
star
75

fairness-indicators

Tensorflow's Fairness Evaluation and Visualization Toolkit
Jupyter Notebook
341
star
76

moonlight

Optical music recognition in TensorFlow
Python
325
star
77

tfjs-tsne

TypeScript
309
star
78

estimator

TensorFlow Estimator
Python
300
star
79

embedding-projector-standalone

HTML
293
star
80

tfjs-layers

TensorFlow.js high-level layers API
TypeScript
283
star
81

build

Build-related tools for TensorFlow
Shell
275
star
82

tflite-micro-arduino-examples

C++
207
star
83

kfac

An implementation of KFAC for TensorFlow
Python
197
star
84

ngraph-bridge

TensorFlow-nGraph bridge
C++
137
star
85

profiler-ui

[Deprecated] The TensorFlow Profiler (TFProf) UI provides a visual interface for profiling TensorFlow models.
HTML
134
star
86

tensorboard-plugin-example

Python
134
star
87

tfx-addons

Developers helping developers. TFX-Addons is a collection of community projects to build new components, examples, libraries, and tools for TFX. The projects are organized under the auspices of the special interest group, SIG TFX-Addons. Join the group at http://goo.gle/tfx-addons-group
Jupyter Notebook
125
star
88

metadata

Utilities for passing TensorFlow-related metadata between tools
Python
102
star
89

networking

Enhanced networking support for TensorFlow. Maintained by SIG-networking.
C++
97
star
90

tfhub.dev

Python
75
star
91

java-ndarray

Java
71
star
92

java-models

Models in Java
Java
71
star
93

tfjs-website

WebGL-accelerated ML // linear algebra // automatic differentiation for JavaScript.
CSS
71
star
94

tfjs-data

Simple APIs to load and prepare data for use in machine learning models
TypeScript
66
star
95

tfx-bsl

Common code for TFX
Python
64
star
96

autograph

Python
50
star
97

model-remediation

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.
Python
42
star
98

codelabs

Jupyter Notebook
36
star
99

tensorstore

C++
25
star
100

swift-bindings

Swift
25
star