[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-tensorflow--privacy":3,"similar-tensorflow--privacy":171},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":14,"owner_avatar_url":15,"owner_bio":16,"owner_company":17,"owner_location":17,"owner_email":18,"owner_twitter":17,"owner_website":19,"owner_url":20,"languages":21,"stars":38,"forks":39,"last_commit_at":40,"license":41,"difficulty_score":42,"env_os":16,"env_gpu":43,"env_ram":44,"env_deps":45,"category_tags":51,"github_topics":53,"view_count":42,"oss_zip_url":17,"oss_zip_packed_at":17,"status":55,"created_at":56,"updated_at":57,"faqs":58,"releases":88},2072,"tensorflow\u002Fprivacy","privacy","Library for training machine learning models with privacy for training data","TensorFlow Privacy 是一个专为机器学习开发者与研究人员设计的 Python 库，旨在帮助大家在训练模型时严格保护数据隐私。它核心解决了传统 AI 训练中可能泄露用户敏感信息的难题，通过引入“差分隐私”技术，确保模型在学习数据规律的同时，无法反推出任何单个样本的具体内容。\n\n该工具基于 TensorFlow 构建，允许用户轻松将标准的优化器（如 SGD、Adam）转换为具备隐私保护功能的版本，并提供了配套的分析工具来量化计算隐私保护的程度。其独特的技术亮点在于最新的高效实现：针对仅包含全连接层和嵌入层的 Keras 模型，它采用了基于逐样本梯度裁剪的新算法。这一改进不仅消除了繁琐的微批次调参需求，更实现了近乎零额外的内存与时间开销，让隐私训练变得高效且易于部署。\n\n无论是希望合规处理敏感数据的工程师，还是深入研究隐私保护算法的学者，TensorFlow Privacy 都提供了从教程到实战的完整支持。随着项目演进，其功能已模块化为独立包，分别专注于隐私模型训练与实证隐私测试，持续为构建可信赖的 AI 系统贡献力量。","# TensorFlow Privacy\n\nThis repository contains the source code for TensorFlow Privacy, a Python\nlibrary that includes implementations of TensorFlow optimizers for training\nmachine learning models with differential privacy. The library comes with\ntutorials and analysis tools for computing the privacy guarantees provided.\n\nThe TensorFlow Privacy library is under continual development, always welcoming\ncontributions. In particular, we always welcome help towards resolving the\nissues currently open.\n\n## Latest Updates\n\n2024-02-14: As of version 0.9.0, the TensorFlow Privacy github repository will\nbe published as two separate PyPI packages. The first will inherit the name\ntensorflow-privacy and contain the parts related to training of DP models. The\nsecond, tensorflow-empirical-privacy, will contain the parts related to testing\nfor empirical privacy.\n\n2023-02-21: A new implementation of efficient per-example gradient clipping is\nnow available for\n[DP keras models](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Ftree\u002Fmaster\u002Ftensorflow_privacy\u002Fprivacy\u002Fkeras_models)\nconsisting only of Dense and Embedding layers. The models use the fast gradient\ncalculation results of [this paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1510.01799). The\nimplementation should allow for doing DP training without any meaningful memory\nor runtime overhead. It also removes the need for tuning the number of\nmicrobatches as it clips the gradient with respect to each example.\n\n## Setting up TensorFlow Privacy\n\n### Dependencies\n\nThis library uses [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F) to define machine\nlearning models. Therefore, installing TensorFlow (>= 1.14) is a pre-requisite.\nYou can find instructions [here](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F). For\nbetter performance, it is also recommended to install TensorFlow with GPU\nsupport (detailed instructions on how to do this are available in the TensorFlow\ninstallation documentation).\n\n### Installing TensorFlow Privacy\n\nIf you only want to use TensorFlow Privacy as a library, you can simply execute\n\n`pip install tensorflow-privacy`\n\nOtherwise, you can clone this GitHub repository into a directory of your choice:\n\n```\ngit clone https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\n```\n\nYou can then install the local package in \"editable\" mode in order to add it to\nyour `PYTHONPATH`:\n\n```\ncd privacy\npip install -e .\n```\n\nIf you'd like to make contributions, we recommend first forking the repository\nand then cloning your fork rather than cloning this repository directly.\n\n## Contributing\n\nContributions are welcomed! Bug fixes and new features can be initiated through\nGitHub pull requests. To speed the code review process, we ask that:\n\n*   When making code contributions to TensorFlow Privacy, you follow the `PEP8\n    with two spaces` coding style (the same as the one used by TensorFlow) in\n    your pull requests. In most cases this can be done by running `autopep8 -i\n    --indent-size 2 \u003Cfile>` on the files you have edited.\n\n*   You should also check your code with pylint and TensorFlow's pylint\n    [configuration file](https:\u002F\u002Fraw.githubusercontent.com\u002Ftensorflow\u002Ftensorflow\u002Fmaster\u002Ftensorflow\u002Ftools\u002Fci_build\u002Fpylintrc)\n    by running `pylint --rcfile=\u002Fpath\u002Fto\u002Fthe\u002Ftf\u002Frcfile \u003Cedited file.py>`.\n\n*   When making your first pull request, you\n    [sign the Google CLA](https:\u002F\u002Fcla.developers.google.com\u002Fclas)\n\n*   We do not accept pull requests that add git submodules because of\n    [the problems that arise when maintaining git submodules](https:\u002F\u002Fmedium.com\u002F@porteneuve\u002Fmastering-git-submodules-34c65e940407)\n\n## Tutorials directory\n\nTo help you get started with the functionalities provided by this library, we\nprovide a detailed walkthrough [here](tutorials\u002Fwalkthrough\u002FREADME.md) that will\nteach you how to wrap existing optimizers (e.g., SGD, Adam, ...) into their\ndifferentially private counterparts using TensorFlow (TF) Privacy. You will also\nlearn how to tune the parameters introduced by differentially private\noptimization and how to measure the privacy guarantees provided using analysis\ntools included in TF Privacy.\n\nIn addition, the `tutorials\u002F` folder comes with scripts demonstrating how to use\nthe library features. The list of tutorials is described in the README included\nin the tutorials directory.\n\nNOTE: the tutorials are maintained carefully. However, they are not considered\npart of the API and they can change at any time without warning. You should not\nwrite 3rd party code that imports the tutorials and expect that the interface\nwill not break.\n\n## Research directory\n\nThis folder contains code to reproduce results from research papers related to\nprivacy in machine learning. It is not maintained as carefully as the tutorials\ndirectory, but rather intended as a convenient archive.\n\n## TensorFlow 2.x\n\nTensorFlow Privacy now works with TensorFlow 2! You can use the new Keras-based\nestimators found in\n`privacy\u002Ftensorflow_privacy\u002Fprivacy\u002Foptimizers\u002Fdp_optimizer_keras.py`.\n\nFor this to work with `tf.keras.Model` and `tf.estimator.Estimator`, however,\nyou need to install TensorFlow 2.4 or later.\n\n## Remarks\n\nThe content of this repository supersedes the following existing folder in the\ntensorflow\u002Fmodels\n[repository](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Fresearch\u002Fdifferential_privacy)\n\n## Contacts\n\nIf you have any questions that cannot be addressed by raising an issue, feel\nfree to contact:\n\n*   Galen Andrew (@galenmandrew)\n*   Steve Chien (@schien1729)\n*   Nicolas Papernot (@npapernot)\n\n## Copyright\n\nCopyright 2019 - Google LLC\n","# TensorFlow Privacy\n\n本仓库包含 TensorFlow Privacy 的源代码，这是一个 Python 库，提供了用于在训练机器学习模型时实现差分隐私的 TensorFlow 优化器实现。该库还附带教程和分析工具，用于计算所保障的隐私边界。\n\nTensorFlow Privacy 库目前仍在持续开发中，我们始终欢迎贡献。特别是，我们非常欢迎帮助解决当前未关闭的问题。\n\n## 最新更新\n\n2024年2月14日：自版本 0.9.0 起，TensorFlow Privacy 的 GitHub 仓库将发布为两个独立的 PyPI 包。第一个包将沿用 `tensorflow-privacy` 的名称，包含与 DP 模型训练相关的部分；第二个包 `tensorflow-empirical-privacy` 将包含与经验性隐私测试相关的部分。\n\n2023年2月21日：现在提供了一种高效的逐样本梯度裁剪的新实现，适用于仅由 Dense 和 Embedding 层组成的 [DP Keras 模型](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Ftree\u002Fmaster\u002Ftensorflow_privacy\u002Fprivacy\u002Fkeras_models)。这些模型利用了 [这篇论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1510.01799) 中快速梯度计算的结果。该实现应能支持在不产生显著内存或运行时开销的情况下进行 DP 训练，并且由于它是针对每个样本单独裁剪梯度，因此不再需要调整微批次的数量。\n\n## 设置 TensorFlow Privacy\n\n### 依赖项\n\n本库使用 [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F) 来定义机器学习模型。因此，安装 TensorFlow（>= 1.14）是先决条件。您可以在 [这里](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) 找到安装说明。为了获得更好的性能，建议安装支持 GPU 的 TensorFlow 版本（详细的安装步骤可在 TensorFlow 官方文档中找到）。\n\n### 安装 TensorFlow Privacy\n\n如果您只想将 TensorFlow Privacy 作为库使用，可以直接执行：\n\n```\npip install tensorflow-privacy\n```\n\n否则，您可以将此 GitHub 仓库克隆到您选择的目录中：\n\n```\ngit clone https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\n```\n\n然后以“可编辑”模式安装本地包，以便将其添加到您的 `PYTHONPATH` 中：\n\n```\ncd privacy\npip install -e .\n```\n\n如果您希望做出贡献，我们建议先 fork 该仓库，再克隆您的 fork，而不是直接克隆本仓库。\n\n## 贡献\n\n我们欢迎各种形式的贡献！错误修复和新功能可以通过 GitHub 的 pull 请求提交。为加快代码审查流程，我们要求：\n\n*   向 TensorFlow Privacy 提交代码时，请在您的 pull 请求中遵循 `PEP8 with two spaces` 编码风格（与 TensorFlow 使用的风格相同）。大多数情况下，只需对您编辑过的文件运行 `autopep8 -i --indent-size 2 \u003Cfile>` 即可。\n*   您还应使用 pylint 并结合 TensorFlow 的 pylint 配置文件（[链接](https:\u002F\u002Fraw.githubusercontent.com\u002Ftensorflow\u002Ftensorflow\u002Fmaster\u002Ftensorflow\u002Ftools\u002Fci_build\u002Fpylintrc)）来检查代码，命令如下：`pylint --rcfile=\u002Fpath\u002Fto\u002Fthe\u002Ftf\u002Frcfile \u003Cedited file.py>`。\n*   在提交首次 pull 请求时，请签署 [Google CLA](https:\u002F\u002Fcla.developers.google.com\u002Fclas)。\n*   我们不接受包含 Git 子模块的 pull 请求，因为维护 Git 子模块会带来诸多问题，详情请参阅 [这篇文章](https:\u002F\u002Fmedium.com\u002F@porteneuve\u002Fmastering-git-submodules-34c65e940407)。\n\n## 教程目录\n\n为了帮助您快速上手本库的功能，我们提供了一份详细的入门指南 [在这里](tutorials\u002Fwalkthrough\u002FREADME.md)，教您如何使用 TensorFlow (TF) Privacy 将现有优化器（如 SGD、Adam 等）包装成其差分隐私版本。您还将学习如何调整差分隐私优化引入的参数，以及如何使用 TF Privacy 中提供的分析工具来衡量隐私保障程度。\n\n此外，`tutorials\u002F` 文件夹中还包含演示库功能的脚本。教程列表在教程目录中的 README 文件中有所说明。\n\n注意：教程内容经过精心维护，但它们并不属于 API 的一部分，可能会在没有任何提前通知的情况下随时更改。请勿编写导入教程的第三方代码，并期望其接口不会发生变化。\n\n## 研究目录\n\n该文件夹包含用于复现机器学习隐私相关研究论文结果的代码。它不像教程目录那样受到严格维护，而是更像一个方便的归档存储。\n\n## TensorFlow 2.x\n\nTensorFlow Privacy 现已支持 TensorFlow 2！您可以使用位于 `privacy\u002Ftensorflow_privacy\u002Fprivacy\u002Foptimizers\u002Fdp_optimizer_keras.py` 中的新 Keras 基础估算器。\n\n不过，要使其与 `tf.keras.Model` 和 `tf.estimator.Estimator` 兼容，您需要安装 TensorFlow 2.4 或更高版本。\n\n## 备注\n\n本仓库的内容取代了 tensorflow\u002Fmodels 仓库中现有的以下文件夹：\n[repository](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Fresearch\u002Fdifferential_privacy)\n\n## 联系方式\n\n如果您有任何无法通过提交 issue 解决的问题，请随时联系：\n\n*   Galen Andrew (@galenmandrew)\n*   Steve Chien (@schien1729)\n*   Nicolas Papernot (@npapernot)\n\n## 版权\n\n版权所有 © 2019 Google LLC","# TensorFlow Privacy 快速上手指南\n\nTensorFlow Privacy 是一个 Python 库，提供了用于训练具有**差分隐私（Differential Privacy, DP）**保护的机器学习模型的 TensorFlow 优化器实现。本指南将帮助你快速搭建环境并开始使用。\n\n## 环境准备\n\n### 系统要求\n- **Python**: 建议 Python 3.6+\n- **TensorFlow**: 版本需 >= 1.14（推荐使用 **TensorFlow 2.4+** 以支持最新的 Keras 接口和高效梯度裁剪功能）。\n- **硬件加速**: 为获得更佳性能，强烈建议安装支持 **GPU** 的 TensorFlow 版本。\n\n### 前置依赖\n在开始之前，请确保已安装 TensorFlow。你可以访问 [TensorFlow 官网](https:\u002F\u002Fwww.tensorflow.org\u002Finstall) 获取详细安装指令。\n\n> **国内开发者提示**：在安装 Python 包时，建议使用国内镜像源以提升下载速度。例如使用清华源：\n> `pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \u003Cpackage_name>`\n\n## 安装步骤\n\n你可以根据需求选择直接安装发布版或从源码安装开发版。\n\n### 方式一：直接安装（推荐普通用户）\n如果你仅需将 TensorFlow Privacy 作为库使用，可直接通过 pip 安装：\n\n```bash\npip install tensorflow-privacy\n```\n*(国内加速)*:\n```bash\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple tensorflow-privacy\n```\n\n> **注意**：自 0.9.0 版本起，该库拆分为两个包：\n> - `tensorflow-privacy`：包含差分隐私模型训练相关功能。\n> - `tensorflow-empirical-privacy`：包含经验隐私测试相关功能。\n> 大多数训练场景只需安装前者。\n\n### 方式二：源码安装（推荐贡献者或需要最新特性者）\n如果你需要修改源码或使用尚未发布的最新功能：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\ncd privacy\npip install -e .\n```\n*(国内加速克隆)*:\n```bash\ngit clone https:\u002F\u002Fgitee.com\u002Fmirrors\u002Ftensorflow-privacy.git\n# 或者使用代理加速 GitHub 克隆\n```\n\n## 基本使用\n\n以下示例展示如何将标准的 SGD 优化器替换为差分隐私优化器，并在 Keras 模型中进行训练。\n\n### 简单示例代码\n\n```python\nimport tensorflow as tf\nfrom tensorflow_privacy.privacy.optimizers import dp_optimizer_keras\n\n# 1. 构建一个简单的 Keras 模型\nmodel = tf.keras.Sequential([\n    tf.keras.layers.Dense(10, activation='relu', input_shape=(5,)),\n    tf.keras.layers.Dense(1)\n])\n\n# 2. 定义差分隐私优化器\n# 参数说明：\n# - learning_rate: 学习率\n# - noise_multiplier: 噪声乘数，控制隐私保护强度\n# - l2_norm_clip: 梯度裁剪范数，限制单个样本对梯度的影响\ndp_optimizer = dp_optimizer_keras.DPKerasSGDOptimizer(\n    learning_rate=0.1,\n    noise_multiplier=1.0,\n    l2_norm_clip=1.0,\n    seed=None\n)\n\n# 3. 编译模型\nmodel.compile(\n    optimizer=dp_optimizer,\n    loss='mean_squared_error',\n    metrics=['accuracy']\n)\n\n# 4. 准备数据 (此处仅为示例占位符)\n# x_train, y_train 应为你的实际数据\nx_train = tf.random.normal((100, 5))\ny_train = tf.random.normal((100, 1))\n\n# 5. 训练模型\n# batch_size 在此处对应于微批次（microbatches）的概念，\n# 新版实现已自动处理每个样本的梯度裁剪，无需手动调整微批次数量。\nmodel.fit(x_train, y_train, epochs=5, batch_size=32)\n```\n\n### 关键点说明\n- **梯度裁剪**：新的实现（针对仅包含 Dense 和 Embedding 层的模型）提供了高效的逐样本梯度裁剪，无需手动设置微批次（microbatches），且几乎没有内存或运行时开销。\n- **隐私计算**：训练完成后，可使用库中提供的分析工具计算具体的隐私保证（epsilon, delta）。详细用法请参考官方 `tutorials\u002F` 目录下的完整教程。","某医疗科技公司正在利用患者的电子病历数据训练疾病预测模型，以满足严格的合规要求并保护患者隐私。\n\n### 没有 privacy 时\n- 模型存在记忆训练数据的风险，攻击者可能通过成员推断攻击还原出特定患者的敏感病史。\n- 为满足 GDPR 或 HIPAA 等法规，团队不得不花费大量时间手动脱敏数据，导致有用特征丢失且模型准确率下降。\n- 无法量化模型到底泄露了多少隐私信息，面对审计时只能提供模糊的“已做处理”说明，缺乏数学证明。\n- 直接共享模型权重给合作研究机构时存在法律顾虑，阻碍了跨机构的科研协作与数据价值流通。\n\n### 使用 privacy 后\n- privacy 内置的差异隐私优化器（如 DP-SGD）在梯度更新阶段自动添加噪声并裁剪梯度，从数学上保证了单个患者数据不会显著影响模型输出。\n- 团队无需再对原始数据进行破坏性脱敏，直接在原始高维数据上训练，既保留了关键医疗特征又满足了合规底线。\n- 利用 privacy 提供的分析工具，可以精确计算并输出具体的隐私预算（epsilon 值），为监管机构提供可验证的隐私保障报告。\n- 基于严格的隐私保证，公司能安全地将训练好的模型权重开源或分享给合作伙伴，极大促进了医疗 AI 生态的协作效率。\n\nprivacy 将抽象的隐私保护理论转化为可落地的代码实现，让开发者能在不牺牲模型实用性的前提下，获得数学级可证明的数据安全保障。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftensorflow_privacy_f2cf60d5.png","tensorflow","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftensorflow_07ed5093.png","",null,"github-admin@tensorflow.org","http:\u002F\u002Fwww.tensorflow.org","https:\u002F\u002Fgithub.com\u002Ftensorflow",[22,26,30,34],{"name":23,"color":24,"percentage":25},"Python","#3572A5",69.6,{"name":27,"color":28,"percentage":29},"Jupyter Notebook","#DA5B0B",27.9,{"name":31,"color":32,"percentage":33},"Starlark","#76d275",1.4,{"name":35,"color":36,"percentage":37},"Shell","#89e051",1,2004,469,"2026-04-04T09:25:43","Apache-2.0",2,"非必需，但推荐安装支持 GPU 的 TensorFlow 以获得更好性能（具体显卡型号、显存大小及 CUDA 版本未在文中说明）","未说明",{"notes":46,"python":44,"dependencies":47},"该库用于训练具有差分隐私功能的机器学习模型。自 v0.9.0 起，项目拆分为两个 PyPI 包：'tensorflow-privacy'（用于训练）和 'tensorflow-empirical-privacy'（用于测试）。若使用 TensorFlow 2.x 的 Keras 模型或 Estimator，需安装 TensorFlow 2.4 或更高版本。贡献代码时需遵循 PEP8 规范（缩进为 2 空格）并签署 Google CLA。",[48,49,50],"tensorflow>=1.14","tensorflow-privacy","tensorflow-empirical-privacy (v0.9.0+)",[52],"开发框架",[54,6],"machine-learning","ready","2026-03-27T02:49:30.150509","2026-04-06T05:16:01.654034",[59,64,69,74,79,84],{"id":60,"question_zh":61,"answer_zh":62,"source_url":63},9432,"为什么在最新版本的 TensorFlow Privacy 中导入 `rdp_accountant` 模块会报错？","RDP 隐私核算器（RDP accountant）已被弃用并从 TensorFlow Privacy 中移除。官方建议改用 Google 的差分隐私库（differential-privacy library）进行隐私核算。如果您需要复现旧论文中的结果，可能需要查找该库的旧版本或迁移到新的核算方法。","https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Fissues\u002F85",{"id":65,"question_zh":66,"answer_zh":67,"source_url":68},9433,"在 Google Colab 中使用 TensorFlow Privacy 时遇到 'No module named tensorflow_privacy' 错误怎么办？","这是预期行为。在 Colab 环境中，您需要显式安装该库才能使用。请运行命令 `!pip install tensorflow-privacy` 进行安装。即使教程中未明确说明，这也是在 Colab 上运行的必要步骤。","https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Fissues\u002F44",{"id":70,"question_zh":71,"answer_zh":72,"source_url":73},9434,"使用 DP 优化器时，当 `num_microbatches` 大于 1 时报错 'Dimension size must be evenly divisible' 是什么原因？","这通常是因为损失函数（loss）的形状不符合微批次（microbatch）切分的要求。请检查是否按照 MNIST Keras 示例顶部的文档说明进行了单行代码修改，确保损失张量的维度能够被 `num_microbatches` 整除。通常需要调整损失计算方式以匹配优化器的期望输入形状。","https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Fissues\u002F17",{"id":75,"question_zh":76,"answer_zh":77,"source_url":78},9435,"为什么我在 PyTorch 中实现的 DP-SGD 准确率低于 TensorFlow 教程中的结果？","准确率差异可能源于网络结构不同或隐私预算（privacy budget）的消耗不同。例如，如果您为了达到更高准确率而增加了训练轮数（epochs），实际上消耗了更多的隐私预算（epsilon 值变大）。在比较结果时，需确保网络架构、超参数以及隐私预算（epsilon, delta）的设置完全一致。","https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Fissues\u002F42",{"id":80,"question_zh":81,"answer_zh":82,"source_url":83},9436,"TensorFlow Privacy 在 TensorFlow 2.0 及以上版本中是否兼容？","早期版本的 TensorFlow Privacy 主要针对 TF 1.x 设计，在 TF 2.0 初期存在兼容性问题（如损失不下降或性能异常）。建议使用支持 TF 2.x 的最新版本库，并确保使用兼容的 API（如 Keras 集成方式）。如果遇到问题，请检查是否启用了 TF 2.x 的行为模式（`tf.compat.v1.disable_eager_execution()` 有时是必要的，具体取决于使用的优化器版本），或直接升级到专为 TF 2 重构后的版本。","https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fprivacy\u002Fissues\u002F72",{"id":85,"question_zh":86,"answer_zh":87,"source_url":63},9437,"如何解释复现 DP-SGD 论文图表时，计算出的 epsilon 值与图中显示的数值不一致？","这种差异通常是由于底层实现从原始的隐私核算方法切换到了基于 Renyi 差分隐私（RDP）的核算器所致。RDP 核算器提供了更紧密的隐私界限，因此计算出的 epsilon 值可能与论文原始图表中的近似值有所不同。只要代码计算出的数值与论文文本描述一致，通常以文本数据为准，图表可能存在缩放或绘制时的近似处理。",[89,94,99,103,108,113,117,121,126,130,135,139,143,148,152,156,161,166],{"id":90,"version":91,"summary_zh":92,"released_at":93},106820,"v0.9.0","Starting from this release, there will be two PyPI packages associated with this project:\r\n\r\n(1) `tensorflow-privacy` (current name), which will contain all DP training related code, and\r\n(2) `tensorflow-empirical-privacy` (new), which will contain all code related to privacy testing. This currently means all code under `tensorflow_privacy\u002Fprivacy\u002Fprivacy_tests`.","2024-02-14T19:18:00",{"id":95,"version":96,"summary_zh":97,"released_at":98},106821,"v0.8.12","Updated, cleaned dependencies.\r\nCompatible with Python 3.11.","2023-10-10T20:00:05",{"id":100,"version":101,"summary_zh":17,"released_at":102},106822,"v0.8.11","2023-10-05T19:04:32",{"id":104,"version":105,"summary_zh":106,"released_at":107},106823,"v0.8.10","Updated to use new dependencies on scipy and dp-accounting.","2023-06-28T19:58:57",{"id":109,"version":110,"summary_zh":111,"released_at":112},106824,"v0.8.8","Update TFP to version 0.8.8.","2023-03-13T18:22:34",{"id":114,"version":115,"summary_zh":17,"released_at":116},106825,"v0.8.5","2022-08-31T20:56:52",{"id":118,"version":119,"summary_zh":17,"released_at":120},106826,"v0.8.2","2022-07-27T21:35:20",{"id":122,"version":123,"summary_zh":124,"released_at":125},106827,"v0.8.1","Various changes, with a focus on fixing issues on integration with dp-accounting library.","2022-07-20T20:56:35",{"id":127,"version":128,"summary_zh":17,"released_at":129},106828,"v.0.8.0","2022-02-22T20:37:34",{"id":131,"version":132,"summary_zh":133,"released_at":134},106829,"0.6.2","New release of Tensorflow Privacy.","2021-07-14T18:55:00",{"id":136,"version":137,"summary_zh":17,"released_at":138},106830,"v.0.5.1","2020-09-03T01:13:47",{"id":140,"version":141,"summary_zh":17,"released_at":142},106831,"v.0.3.0","2020-05-01T23:44:28",{"id":144,"version":145,"summary_zh":146,"released_at":147},106832,"0.2.3","Adding archives related to distribution density research: the archives contain the prototypicality orders described in https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.13427","2020-03-20T18:04:59",{"id":149,"version":150,"summary_zh":17,"released_at":151},106833,"v.0.2.2","2019-10-31T02:09:08",{"id":153,"version":154,"summary_zh":17,"released_at":155},106834,"v.0.2.1","2019-10-22T20:41:45",{"id":157,"version":158,"summary_zh":159,"released_at":160},106835,"v.0.2.0","Main change is revamping the directory structure to be more consistent with other projects in the Tensorflow ecosystem. Disruption should be minimal, but we apologize for any inconvenience.","2019-10-15T21:10:36",{"id":162,"version":163,"summary_zh":164,"released_at":165},106836,"v.0.1.0","Bring version in line with semantic versioning.","2019-10-02T22:07:30",{"id":167,"version":168,"summary_zh":169,"released_at":170},106837,"v.0.0.1","First PyPI release for TF Privacy","2019-08-23T16:22:10",[172,183,192,200,208,221],{"id":173,"name":174,"github_repo":175,"description_zh":176,"stars":177,"difficulty_score":178,"last_commit_at":179,"category_tags":180,"status":55},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[52,181,182],"图像","Agent",{"id":184,"name":185,"github_repo":186,"description_zh":187,"stars":188,"difficulty_score":42,"last_commit_at":189,"category_tags":190,"status":55},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,"2026-04-05T11:33:21",[52,182,191],"语言模型",{"id":193,"name":194,"github_repo":195,"description_zh":196,"stars":197,"difficulty_score":42,"last_commit_at":198,"category_tags":199,"status":55},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[52,181,182],{"id":201,"name":202,"github_repo":203,"description_zh":204,"stars":205,"difficulty_score":42,"last_commit_at":206,"category_tags":207,"status":55},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[52,191],{"id":209,"name":210,"github_repo":211,"description_zh":212,"stars":213,"difficulty_score":42,"last_commit_at":214,"category_tags":215,"status":55},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[181,216,217,218,182,219,191,52,220],"数据工具","视频","插件","其他","音频",{"id":222,"name":223,"github_repo":224,"description_zh":225,"stars":226,"difficulty_score":178,"last_commit_at":227,"category_tags":228,"status":55},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[182,181,52,191,219]]