TensorFlow Addons
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TensorFlow Addons 是一个符合完善的 API 模式但实现了核心 TensorFlow 中未提供的新功能的贡献仓库。TensorFlow 原生支持大量算子、层、指标、损失和优化器。但是,在像机器学习一样的快速发展领域中,有许多有趣的新开发成果无法集成到核心 TensorFlow 中(因为它们的广泛适用性尚不明确,或者主要由社区的较小子集使用)。
安装
稳定版本
要安装最新版本,请运行以下命令:
pip install tensorflow-addons
要使用插件:
import tensorflow as tf
import tensorflow_addons as tfa
Nightly 版本
此外,TensorFlow Addons 的 pip 软件包 tfa-nightly
下还有 Nightly 版本,该软件包是针对 TensorFlow 的最新稳定版本构建的。Nightly 版本包含较新的功能,但可能不如带版本号的版本稳定。
pip install tfa-nightly
从源安装
您也可以从源安装。这需要 Bazel 构建系统。
git clone https://github.com/tensorflow/addons.git
cd addons
# If building GPU Ops (Requires CUDA 10.0 and CuDNN 7)
export TF_NEED_CUDA=1
export CUDA_HOME="/path/to/cuda10" (default: /usr/local/cuda)
export CUDNN_INSTALL_PATH="/path/to/cudnn" (default: /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
核心理念
子软件包中的标准化 API
用户体验和项目可维护性是 TF-Addons 中的核心理念。为了实现这些目标,我们要求添加的插件符合核心 TensorFlow 中完善的 API 模式。
GPU/CPU 自定义运算
TensorFlow Addons 的主要好处是提供预编译运算。如果未找到 CUDA 10 安装,则运算将自动退回到 CPU 实现。
代理维护权
Addons 设计为区分子软件包和子模块,以便对相关组件具有专业知识和浓厚兴趣的用户可以维护它们。
仅在做出实质性贡献后才会授予子软件包维护权,目的是限制拥有写入权限的用户数量。贡献可以是问题关闭、错误修复、文档、新代码或优化现有代码。授予子模块维护权的门槛较低,因为它不包括对仓库的写入权限。
有关此主题的更多信息,请参阅 RFC。
子软件包的定期评估
鉴于此仓库的性质,随着时间的推移,子软件包和子模块对社区的用处可能越来越少。为了保持仓库的可持续性,我们将每半年对代码执行一次审核,以确保所有内容仍属于仓库。这种审核的促成因素包括:
- 活跃维护者数量
- OSS 使用量
- 归因于代码的问题或错误数量
- 如果现在有更好的解决方案
TensorFlow Addons 中的功能可以分为三类:
- 建议:完善的 API;鼓励使用。
- 不鼓励:已有更好的选择。保留 API 是出于历史原因;或者 API 需要维护,并且处于弃用的等待时间。
- 弃用:使用风险自负;随时会删除。
这三个组之间的状态更改为:建议 <-> 不鼓励 -> 弃用。
一个 API 从被标记为弃用到被删除之间的间隔为 90 天。理由如下:
如果 TensorFlow Addons 每月发布一次,则在删除 API 之前将有 2-3 个版本。版本说明可能会给用户提供足够的警告。
90 天为维护人员提供了充足的时间来修复其代码。
贡献
TF-Addons 是一个社区主导的开源项目。因此,该项目取决于公共贡献、错误修复和文档。有关如何贡献的指南,请参阅贡献准则。此项目遵循 TensorFlow 的行为准则。参与,即表示您同意遵守此准则。
社区
许可证
Apache License 2.0
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-01-11。
[null,null,["最后更新时间 (UTC):2024-01-11。"],[],[],null,["# TensorFlow Addons\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n**TensorFlow Addons** is a repository of contributions that conform to\nwell-established API patterns, but implement new functionality\nnot available in core TensorFlow. TensorFlow natively supports\na large number of operators, layers, metrics, losses, and optimizers.\nHowever, in a fast moving field like ML, there are many interesting new\ndevelopments that cannot be integrated into core TensorFlow\n(because their broad applicability is not yet clear, or it is mostly\nused by a smaller subset of the community).\n\nInstallation\n------------\n\n#### Stable Builds\n\nTo install the latest version, run the following: \n\n pip install tensorflow-addons\n\nTo use addons: \n\n import tensorflow as tf\n import tensorflow_addons as tfa\n\n#### Nightly Builds\n\nThere are also nightly builds of TensorFlow Addons under the pip package\n`tfa-nightly`, which is built against the latest stable version of TensorFlow. Nightly builds\ninclude newer features, but may be less stable than the versioned releases. \n\n pip install tfa-nightly\n\n#### Installing from Source\n\nYou can also install from source. This requires the [Bazel](https://bazel.build/) build system. \n\n git clone https://github.com/tensorflow/addons.git\n cd addons\n\n # If building GPU Ops (Requires CUDA 10.0 and CuDNN 7)\n export TF_NEED_CUDA=1\n export CUDA_TOOLKIT_PATH=\"/path/to/cuda10\" (default: /usr/local/cuda)\n export CUDNN_INSTALL_PATH=\"/path/to/cudnn\" (default: /usr/lib/x86_64-linux-gnu)\n\n # This script links project with TensorFlow dependency\n python3 ./configure.py\n\n bazel build build_pip_pkg\n bazel-bin/build_pip_pkg artifacts\n\n pip install artifacts/tensorflow_addons-*.whl\n\nCore Concepts\n-------------\n\n#### Standardized API within Subpackages\n\nUser experience and project maintainability are core concepts in\nTF-Addons. In order to achieve these we require that our additions\nconform to established API patterns seen in core TensorFlow.\n\n#### GPU/CPU Custom-Ops\n\nA major benefit of TensorFlow Addons is that there are precompiled ops. Should\na CUDA 10 installation not be found then the op will automatically fall back to\na CPU implementation.\n\n#### Proxy Maintainership\n\nAddons has been designed to compartmentalize subpackages and submodules so\nthat they can be maintained by users who have expertise and a vested interest\nin that component.\n\nSubpackage maintainership will only be granted after substantial contribution\nhas been made in order to limit the number of users with write permission.\nContributions can come in the form of issue closings, bug fixes, documentation,\nnew code, or optimizing existing code. Submodule maintainership can be granted\nwith a lower barrier for entry as this will not include write permissions to\nthe repo.\n\nFor more information see [the RFC](https://github.com/tensorflow/community/blob/master/rfcs/20190308-addons-proxy-maintainership.md)\non this topic.\n\n#### Periodic Evaluation of Subpackages\n\nGiven the nature of this repository, subpackages and submodules may become less\nand less useful to the community as time goes on. In order to keep the\nrepository sustainable, we'll be performing bi-annual reviews of our code to\nensure everything still belongs within the repo. Contributing factors to this\nreview will be:\n\n1. Number of active maintainers\n2. Amount of OSS use\n3. Amount of issues or bugs attributed to the code\n4. If a better solution is now available\n\nFunctionality within TensorFlow Addons can be categorized into three groups:\n\n- **Suggested**: well-maintained API; use is encouraged.\n- **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.\n- **Deprecated**: use at your own risk; subject to be deleted.\n\nThe status change between these three groups is:\nSuggested \\\u003c-\\\u003e Discouraged -\\\u003e Deprecated.\n\nThe period between an API being marked as deprecated and being deleted will be\n90 days. The rationale being:\n\n1. In the event that TensorFlow Addons releases monthly, there will be 2-3\n releases before an API is deleted. The release notes could give user enough\n warning.\n\n2. 90 days gives maintainers ample time to fix their code.\n\nContributing\n------------\n\nTF-Addons is a community led open source project. As such, the project\ndepends on public contributions, bug-fixes, and documentation. Please see\n[contribution guidelines](https://github.com/tensorflow/addons/blob/master/CONTRIBUTING.md)\nfor a guide on how to contribute. This project adheres to [TensorFlow's code of conduct](https://github.com/tensorflow/addons/blob/master/CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code.\n\nCommunity\n---------\n\n- [Public Mailing List](https://groups.google.com/a/tensorflow.org/forum/#!forum/addons)\n- [SIG Monthly Meeting Notes](https://docs.google.com/document/d/1kxg5xIHWLY7EMdOJCdSGgaPu27a9YKpupUz2VTXqTJg)\n - Join our mailing list and receive calendar invites to the meeting\n\nLicense\n-------\n\n[Apache License 2.0](/addons/LICENSE)"]]