[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-google-deepmind--sonnet":3,"tool-google-deepmind--sonnet":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",156033,2,"2026-04-14T23:32:00",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":32,"env_os":96,"env_gpu":97,"env_ram":96,"env_deps":98,"category_tags":104,"github_topics":105,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":111,"updated_at":112,"faqs":113,"releases":151},7628,"google-deepmind\u002Fsonnet","sonnet","TensorFlow-based neural network library","Sonnet 是由 DeepMind 研究人员基于 TensorFlow 2 打造的神经网络库，旨在为机器学习研究提供简洁且可组合的抽象构建块。它主要解决了传统框架中模型结构复杂、耦合度高以及训练逻辑固化的问题，让开发者能够更专注于算法创新而非底层实现细节。\n\n这款工具特别适合人工智能研究人员、算法工程师及深度学习开发者使用。Sonnet 的核心设计理念围绕唯一的概念\"snt.Module\"展开，模块内部可独立管理参数、子模块及计算方法，彼此之间完全解耦。与许多“ opinionated\"（强观点）的框架不同，Sonnet 不强制绑定特定的训练流程，用户可自由构建或复用现有的训练策略，灵活性极高。\n\n其技术亮点在于“延迟初始化”机制：模块的参数形状通常在首次接收输入数据时自动推导并创建，无需预先手动定义繁琐的维度信息。此外，Sonnet 内置了丰富的预定义模块（如线性层、卷积层、批归一化等）及经典网络结构，同时也鼓励用户根据需求自定义模块。配合清晰的代码风格和详尽的文档，Sonnet 让构建从监督学习到强化学习等各类神经网络变得简单直观，是探索前沿 AI 模型的得力助手。","![Sonnet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-deepmind_sonnet_readme_6aeba964b79e.png)\n\n# Sonnet\n\n[**Documentation**](https:\u002F\u002Fsonnet.readthedocs.io\u002F) | [**Examples**](#examples)\n\nSonnet is a library built on top of [TensorFlow 2](https:\u002F\u002Fwww.tensorflow.org\u002F)\ndesigned to provide simple, composable abstractions for machine learning\nresearch.\n\n# Introduction\n\nSonnet has been designed and built by researchers at DeepMind. It can be used to\nconstruct neural networks for many different purposes (un\u002Fsupervised learning,\nreinforcement learning, ...). We find it is a successful abstraction for our\norganization, you might too!\n\nMore specifically, Sonnet provides a simple but powerful programming model\ncentered around a single concept: `snt.Module`. Modules can hold references to\nparameters, other modules and methods that apply some function on the user\ninput. Sonnet ships with many predefined modules (e.g. `snt.Linear`,\n`snt.Conv2D`, `snt.BatchNorm`) and some predefined networks of modules (e.g.\n`snt.nets.MLP`) but users are also encouraged to build their own modules.\n\nUnlike many frameworks Sonnet is extremely unopinionated about **how** you will\nuse your modules. Modules are designed to be self contained and entirely\ndecoupled from one another. Sonnet does not ship with a training framework and\nusers are encouraged to build their own or adopt those built by others.\n\nSonnet is also designed to be simple to understand, our code is (hopefully!)\nclear and focussed. Where we have picked defaults (e.g. defaults for initial\nparameter values) we try to point out why.\n\n# Getting Started\n\n## Examples\n\nThe easiest way to try Sonnet is to use Google Colab which offers a free Python\nnotebook attached to a GPU or TPU.\n\n- [Predicting MNIST with an MLP](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fmlp_on_mnist.ipynb)\n- [Training a Little GAN on MNIST](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Flittle_gan_on_mnist.ipynb)\n- [Distributed training with `snt.distribute`](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb)\n\n## Installation\n\nTo get started install TensorFlow 2.0 and Sonnet 2:\n\n```shell\n$ pip install tensorflow tensorflow-probability\n$ pip install dm-sonnet\n```\n\nYou can run the following to verify things installed correctly:\n\n```python\nimport tensorflow as tf\nimport sonnet as snt\n\nprint(\"TensorFlow version {}\".format(tf.__version__))\nprint(\"Sonnet version {}\".format(snt.__version__))\n```\n\n### Using existing modules\n\nSonnet ships with a number of built in modules that you can trivially use. For\nexample to define an MLP we can use the `snt.Sequential` module to call a\nsequence of modules, passing the output of a given module as the input for the\nnext module. We can use `snt.Linear` and `tf.nn.relu` to actually define our\ncomputation:\n\n```python\nmlp = snt.Sequential([\n    snt.Linear(1024),\n    tf.nn.relu,\n    snt.Linear(10),\n])\n```\n\nTo use our module we need to \"call\" it. The `Sequential` module (and most\nmodules) define a `__call__` method that means you can call them by name:\n\n```python\nlogits = mlp(tf.random.normal([batch_size, input_size]))\n```\n\nIt is also very common to request all the parameters for your module. Most\nmodules in Sonnet create their parameters the first time they are called with\nsome input (since in most cases the shape of the parameters is a function of\nthe input). Sonnet modules provide two properties for accessing parameters.\n\nThe `variables` property returns **all** `tf.Variable`s that are referenced by\nthe given module:\n\n```python\nall_variables = mlp.variables\n```\n\nIt is worth noting that `tf.Variable`s are not just used for parameters of your\nmodel. For example they are used to hold state in metrics used in\n`snt.BatchNorm`. In most cases users retrieve the module variables to pass them\nto an optimizer to be updated. In this case non-trainable variables should\ntypically not be in that list as they are updated via a different mechanism.\nTensorFlow has a built in mechanism to mark variables as \"trainable\" (parameters\nof your model) vs. non-trainable (other variables). Sonnet provides a mechanism\nto gather all trainable variables from your module which is probably what you\nwant to pass to an optimizer:\n\n```python\nmodel_parameters = mlp.trainable_variables\n```\n\n### Building your own module\n\nSonnet strongly encourages users to subclass `snt.Module` to define their own\nmodules. Let's start by creating a simple `Linear` layer called `MyLinear`:\n\n```python\nclass MyLinear(snt.Module):\n\n  def __init__(self, output_size, name=None):\n    super(MyLinear, self).__init__(name=name)\n    self.output_size = output_size\n\n  @snt.once\n  def _initialize(self, x):\n    initial_w = tf.random.normal([x.shape[1], self.output_size])\n    self.w = tf.Variable(initial_w, name=\"w\")\n    self.b = tf.Variable(tf.zeros([self.output_size]), name=\"b\")\n\n  def __call__(self, x):\n    self._initialize(x)\n    return tf.matmul(x, self.w) + self.b\n```\n\nUsing this module is trivial:\n\n```python\nmod = MyLinear(32)\nmod(tf.ones([batch_size, input_size]))\n```\n\nBy subclassing `snt.Module` you get many nice properties for free. For example\na default implementation of `__repr__` which shows constructor arguments (very\nuseful for debugging and introspection):\n\n```python\n>>> print(repr(mod))\nMyLinear(output_size=10)\n```\n\nYou also get the `variables` and `trainable_variables` properties:\n\n```python\n>>> mod.variables\n(\u003Ctf.Variable 'my_linear\u002Fb:0' shape=(10,) ...)>,\n \u003Ctf.Variable 'my_linear\u002Fw:0' shape=(1, 10) ...)>)\n```\n\nYou may notice the `my_linear` prefix on the variables above. This is because\nSonnet modules also enter the modules name scope whenever methods are called.\nBy entering the module name scope we provide a much more useful graph for tools\nlike TensorBoard to consume (e.g. all operations that occur inside my_linear\nwill be in a group called my_linear).\n\nAdditionally your module will now support TensorFlow checkpointing and saved\nmodel which are advanced features covered later.\n\n# Serialization\n\nSonnet supports multiple serialization formats. The simplest format we support\nis Python's `pickle`, and all built in modules are tested to make sure they can\nbe saved\u002Floaded via pickle in the same Python process. In general we discourage\nthe use of pickle, it is not well supported by many parts of TensorFlow and in\nour experience can be quite brittle.\n\n## TensorFlow Checkpointing\n\n**Reference:** https:\u002F\u002Fwww.tensorflow.org\u002Falpha\u002Fguide\u002Fcheckpoints\n\nTensorFlow checkpointing can be used to save the value of parameters\nperiodically during training. This can be useful to save the progress of\ntraining in case your program crashes or is stopped. Sonnet is designed to work\ncleanly with TensorFlow checkpointing:\n\n```python\ncheckpoint_root = \"\u002Ftmp\u002Fcheckpoints\"\ncheckpoint_name = \"example\"\nsave_prefix = os.path.join(checkpoint_root, checkpoint_name)\n\nmy_module = create_my_sonnet_module()  # Can be anything extending snt.Module.\n\n# A `Checkpoint` object manages checkpointing of the TensorFlow state associated\n# with the objects passed to it's constructor. Note that Checkpoint supports\n# restore on create, meaning that the variables of `my_module` do **not** need\n# to be created before you restore from a checkpoint (their value will be\n# restored when they are created).\ncheckpoint = tf.train.Checkpoint(module=my_module)\n\n# Most training scripts will want to restore from a checkpoint if one exists. This\n# would be the case if you interrupted your training (e.g. to use your GPU for\n# something else, or in a cloud environment if your instance is preempted).\nlatest = tf.train.latest_checkpoint(checkpoint_root)\nif latest is not None:\n  checkpoint.restore(latest)\n\nfor step_num in range(num_steps):\n  train(my_module)\n\n  # During training we will occasionally save the values of weights. Note that\n  # this is a blocking call and can be slow (typically we are writing to the\n  # slowest storage on the machine). If you have a more reliable setup it might be\n  # appropriate to save less frequently.\n  if step_num and not step_num % 1000:\n    checkpoint.save(save_prefix)\n\n# Make sure to save your final values!!\ncheckpoint.save(save_prefix)\n```\n\n## TensorFlow Saved Model\n\n**Reference:** https:\u002F\u002Fwww.tensorflow.org\u002Falpha\u002Fguide\u002Fsaved_model\n\nTensorFlow saved models can be used to save a copy of your network that is\ndecoupled from the Python source for it. This is enabled by saving a TensorFlow\ngraph describing the computation and a checkpoint containing the value of\nweights.\n\nThe first thing to do in order to create a saved model is to create a\n`snt.Module` that you want to save:\n\n```python\nmy_module = snt.nets.MLP([1024, 1024, 10])\nmy_module(tf.ones([1, input_size]))\n```\n\nNext, we need to create another module describing the specific parts of our\nmodel that we want to export. We advise doing this (rather than modifying the\noriginal model in-place) so you have fine grained control over what is actually\nexported. This is typically important to avoid creating very large saved models,\nand such that you only share the parts of your model you want to (e.g. you only\nwant to share the generator for a GAN but keep the discriminator private).\n\n```python\n@tf.function(input_signature=[tf.TensorSpec([None, input_size])])\ndef inference(x):\n  return my_module(x)\n\nto_save = snt.Module()\nto_save.inference = inference\nto_save.all_variables = list(my_module.variables)\ntf.saved_model.save(to_save, \"\u002Ftmp\u002Fexample_saved_model\")\n```\n\nWe now have a saved model in the `\u002Ftmp\u002Fexample_saved_model` folder:\n\n```shell\n$ ls -lh \u002Ftmp\u002Fexample_saved_model\ntotal 24K\ndrwxrwsr-t 2 tomhennigan 154432098 4.0K Apr 28 00:14 assets\n-rw-rw-r-- 1 tomhennigan 154432098  14K Apr 28 00:15 saved_model.pb\ndrwxrwsr-t 2 tomhennigan 154432098 4.0K Apr 28 00:15 variables\n```\n\nLoading this model is simple and can be done on a different machine without any\nof the Python code that built the saved model:\n\n```python\nloaded = tf.saved_model.load(\"\u002Ftmp\u002Fexample_saved_model\")\n\n# Use the inference method. Note this doesn't run the Python code from `to_save`\n# but instead uses the TensorFlow Graph that is part of the saved model.\nloaded.inference(tf.ones([1, input_size]))\n\n# The all_variables property can be used to retrieve the restored variables.\nassert len(loaded.all_variables) > 0\n```\n\nNote that the loaded object is not a Sonnet module, it is a container object\nthat has the specific methods (e.g. `inference`) and properties (e.g.\n`all_variables`) that we added in the previous block.\n\n## Distributed training\n\n**Example:** https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb\n\nSonnet has support for distributed training using\n[custom TensorFlow distribution strategies](https:\u002F\u002Fsonnet.readthedocs.io\u002Fen\u002Flatest\u002Fapi.html#module-sonnet.distribute).\n\nA key difference between Sonnet and distributed training using `tf.keras` is\nthat Sonnet modules and optimizers do not behave differently when run under\ndistribution strategies (e.g. we do not average your gradients or sync your\nbatch norm stats). We believe that users should be in full control of these\naspects of their training and they should not be baked into the library. The\ntrade off here is that you need to implement these features in your training\nscript (typically this is just 2 lines of code to all reduce your gradients\nbefore applying your optimizer) or swap in modules that are explicitly\ndistribution aware (e.g. `snt.distribute.CrossReplicaBatchNorm`).\n\nOur [distributed Cifar-10](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb)\nexample walks through doing multi-GPU training with Sonnet.\n","![Sonnet](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-deepmind_sonnet_readme_6aeba964b79e.png)\n\n# Sonnet\n\n[**文档**](https:\u002F\u002Fsonnet.readthedocs.io\u002F) | [**示例**](#examples)\n\nSonnet 是一个构建在 [TensorFlow 2](https:\u002F\u002Fwww.tensorflow.org\u002F) 之上的库，旨在为机器学习研究提供简单、可组合的抽象。\n\n# 简介\n\nSonnet 由 DeepMind 的研究人员设计和开发。它可以用于构建各种用途的神经网络（无监督\u002F有监督学习、强化学习等）。我们发现它对我们的团队非常有效，你也许也会喜欢！\n\n具体来说，Sonnet 提供了一个简单而强大的编程模型，核心概念是 `snt.Module`。模块可以包含参数、其他模块以及对用户输入应用某些函数的方法。Sonnet 自带许多预定义模块（如 `snt.Linear`、`snt.Conv2D`、`snt.BatchNorm`）和一些预定义的模块网络（如 `snt.nets.MLP`），同时也鼓励用户自定义模块。\n\n与许多框架不同，Sonnet 对 **如何** 使用模块持开放态度。模块被设计成自包含且彼此完全解耦。Sonnet 不自带训练框架，而是鼓励用户自行构建或采用他人开发的框架。\n\nSonnet 还致力于简洁易懂，我们的代码（希望）清晰且专注。当我们选择默认值时（例如初始参数值的默认值），我们会说明原因。\n\n# 快速入门\n\n## 示例\n\n尝试 Sonnet 的最简单方式是使用 Google Colab，它提供免费的 Python 笔记本，并配备 GPU 或 TPU。\n\n- [使用 MLP 预测 MNIST](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fmlp_on_mnist.ipynb)\n- [在 MNIST 上训练一个小 GAN](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Flittle_gan_on_mnist.ipynb)\n- [使用 `snt.distribute` 进行分布式训练](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb)\n\n## 安装\n\n要开始使用，请安装 TensorFlow 2.0 和 Sonnet 2：\n\n```shell\n$ pip install tensorflow tensorflow-probability\n$ pip install dm-sonnet\n```\n\n你可以运行以下代码来验证是否安装正确：\n\n```python\nimport tensorflow as tf\nimport sonnet as snt\n\nprint(\"TensorFlow 版本 {}\".format(tf.__version__))\nprint(\"Sonnet 版本 {}\".format(snt.__version__))\n```\n\n### 使用现有模块\n\nSonnet 自带许多内置模块，你可以直接使用。例如，要定义一个 MLP，我们可以使用 `snt.Sequential` 模块来按顺序调用多个模块，将前一个模块的输出作为下一个模块的输入。我们可以使用 `snt.Linear` 和 `tf.nn.relu` 来实际定义计算过程：\n\n```python\nmlp = snt.Sequential([\n    snt.Linear(1024),\n    tf.nn.relu,\n    snt.Linear(10),\n])\n```\n\n要使用这个模块，我们需要“调用”它。`Sequential` 模块（以及大多数模块）都定义了 `__call__` 方法，这意味着你可以直接通过名称调用它们：\n\n```python\nlogits = mlp(tf.random.normal([batch_size, input_size]))\n```\n\n通常，我们还会获取模块的所有参数。Sonnet 中的大多数模块会在第一次被调用并传入输入时创建其参数（因为参数的形状通常是输入的函数）。Sonnet 模块提供了两个属性来访问这些参数。\n\n`variables` 属性会返回给定模块引用的所有 `tf.Variable`：\n\n```python\nall_variables = mlp.variables\n```\n\n需要注意的是，`tf.Variable` 并不只用于模型的参数。例如，它们还用于存储 `snt.BatchNorm` 中指标的状态。大多数情况下，用户会提取模块的变量以传递给优化器进行更新。然而，不可训练的变量通常不应包含在该列表中，因为它们是通过另一种机制更新的。TensorFlow 内置了标记变量为“可训练”（模型参数）或“不可训练”（其他变量）的机制。Sonnet 提供了一种从模块中收集所有可训练变量的方法，这通常是你要传递给优化器的内容：\n\n```python\nmodel_parameters = mlp.trainable_variables\n```\n\n### 构建自己的模块\n\nSonnet 强烈鼓励用户继承 `snt.Module` 来定义自己的模块。让我们从创建一个简单的线性层 `MyLinear` 开始：\n\n```python\nclass MyLinear(snt.Module):\n\n  def __init__(self, output_size, name=None):\n    super(MyLinear, self).__init__(name=name)\n    self.output_size = output_size\n\n  @snt.once\n  def _initialize(self, x):\n    initial_w = tf.random.normal([x.shape[1], self.output_size])\n    self.w = tf.Variable(initial_w, name=\"w\")\n    self.b = tf.Variable(tf.zeros([self.output_size]), name=\"b\")\n\n  def __call__(self, x):\n    self._initialize(x)\n    return tf.matmul(x, self.w) + self.b\n```\n\n使用这个模块非常简单：\n\n```python\nmod = MyLinear(32)\nmod(tf.ones([batch_size, input_size]))\n```\n\n通过继承 `snt.Module`，你可以免费获得许多便利的功能。例如，默认实现的 `__repr__` 方法，会显示构造函数的参数（非常有助于调试和内省）：\n\n```python\n>>> print(repr(mod))\nMyLinear(output_size=10)\n```\n\n你还可以使用 `variables` 和 `trainable_variables` 属性：\n\n```python\n>>> mod.variables\n(\u003Ctf.Variable 'my_linear\u002Fb:0' shape=(10,) ...>,\n \u003Ctf.Variable 'my_linear\u002Fw:0' shape=(1, 10) ...>)\n```\n\n你可能会注意到上述变量名前都有 `my_linear` 前缀。这是因为当方法被调用时，Sonnet 模块会进入模块的命名空间。通过进入模块的命名空间，我们可以为 TensorBoard 等工具提供更有用的图结构（例如，所有发生在 `my_linear` 内的操作都会被归类到名为 `my_linear` 的组中）。\n\n此外，你的模块现在也支持 TensorFlow 的检查点保存和模型保存功能，这些高级特性将在后面介绍。\n\n# 序列化\n\nSonnet 支持多种序列化格式。我们支持的最简单格式是 Python 的 `pickle`，所有内置模块都经过测试，确保可以在同一 Python 进程中通过 `pickle` 保存和加载。不过，我们通常不建议使用 `pickle`，因为它在 TensorFlow 的许多部分中支持不佳，而且在实践中往往比较脆弱。\n\n## TensorFlow 检查点\n\n**参考：** https:\u002F\u002Fwww.tensorflow.org\u002Falpha\u002Fguide\u002Fcheckpoints\n\nTensorFlow 检查点可用于在训练过程中定期保存参数值。这在程序崩溃或中断时保存训练进度非常有用。Sonnet 与 TensorFlow 检查点能够很好地协同工作：\n\n```python\ncheckpoint_root = \"\u002Ftmp\u002Fcheckpoints\"\ncheckpoint_name = \"example\"\nsave_prefix = os.path.join(checkpoint_root, checkpoint_name)\n\nmy_module = create_my_sonnet_module()  # 可以是任何继承自 snt.Module 的对象。\n\n# `Checkpoint` 对象管理与其构造函数中传入的对象相关联的 TensorFlow 状态的检查点保存。请注意，Checkpoint 支持在创建时恢复，这意味着 `my_module` 的变量**无需**在从检查点恢复之前被创建（它们的值将在被创建时被恢复）。\ncheckpoint = tf.train.Checkpoint(module=my_module)\n\n# 大多数训练脚本都会希望在存在检查点的情况下从中恢复。例如，如果你中断了训练（比如为了将 GPU 用于其他任务，或者在云环境中实例被抢占），就需要进行恢复。\nlatest = tf.train.latest_checkpoint(checkpoint_root)\nif latest is not None:\n  checkpoint.restore(latest)\n\nfor step_num in range(num_steps):\n  train(my_module)\n\n  # 在训练过程中，我们会偶尔保存权重的值。需要注意的是，这是一个阻塞调用，可能会比较慢（通常是在机器上速度最慢的存储设备上写入数据）。如果你的环境更加可靠，可能可以适当减少保存频率。\n  if step_num > 0 and step_num % 1000 == 0:\n    checkpoint.save(save_prefix)\n\n# 务必保存最终的模型参数！！\ncheckpoint.save(save_prefix)\n```\n\n## TensorFlow Saved Model\n\n**参考:** https:\u002F\u002Fwww.tensorflow.org\u002Falpha\u002Fguide\u002Fsaved_model\n\nTensorFlow 的 Saved Model 可以用来保存一份与 Python 源代码解耦的网络副本。这是通过保存描述计算过程的 TensorFlow 图以及包含权重值的检查点来实现的。\n\n要创建一个 Saved Model，首先需要创建一个你想要保存的 `snt.Module`：\n\n```python\nmy_module = snt.nets.MLP([1024, 1024, 10])\nmy_module(tf.ones([1, input_size]))\n```\n\n接下来，我们需要创建另一个模块，用于描述我们想要导出的模型的具体部分。我们建议这样做（而不是直接修改原始模型），以便对实际导出的内容有更精细的控制。这通常很重要，可以避免生成非常大的 Saved Model，并且只共享你希望公开的部分（例如，你只想共享 GAN 的生成器，而保持判别器私密）。\n\n```python\n@tf.function(input_signature=[tf.TensorSpec([None, input_size])])\ndef inference(x):\n  return my_module(x)\n\nto_save = snt.Module()\nto_save.inference = inference\nto_save.all_variables = list(my_module.variables)\ntf.saved_model.save(to_save, \"\u002Ftmp\u002Fexample_saved_model\")\n```\n\n现在，我们在 `\u002Ftmp\u002Fexample_saved_model` 文件夹中有了一个 Saved Model：\n\n```shell\n$ ls -lh \u002Ftmp\u002Fexample_saved_model\ntotal 24K\ndrwxrwsr-t 2 tomhennigan 154432098 4.0K Apr 28 00:14 assets\n-rw-rw-r-- 1 tomhennigan 154432098  14K Apr 28 00:15 saved_model.pb\ndrwxrwsr-t 2 tomhennigan 154432098 4.0K Apr 28 00:15 variables\n```\n\n加载这个模型非常简单，甚至可以在没有构建该 Saved Model 的任何 Python 代码的另一台机器上完成：\n\n```python\nloaded = tf.saved_model.load(\"\u002Ftmp\u002Fexample_saved_model\")\n\n# 使用 inference 方法。请注意，这并不会运行 `to_save` 中的 Python 代码，而是使用 Saved Model 中包含的 TensorFlow 图。\nloaded.inference(tf.ones([1, input_size]))\n\n# 可以使用 all_variables 属性来获取已恢复的变量。\nassert len(loaded.all_variables) > 0\n```\n\n需要注意的是，加载后的对象并不是 Sonnet 模块，而是一个容器对象，它包含了我们在前面步骤中添加的特定方法（如 `inference`）和属性（如 `all_variables`）。\n\n## 分布式训练\n\n**示例:** https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb\n\nSonnet 支持使用 [自定义的 TensorFlow 分布式策略](https:\u002F\u002Fsonnet.readthedocs.io\u002Fen\u002Flatest\u002Fapi.html#module-sonnet.distribute) 进行分布式训练。\n\nSonnet 与使用 `tf.keras` 进行分布式训练的一个关键区别在于，Sonnet 模块和优化器在分布式策略下运行时的行为不会发生变化（例如，我们不会对梯度进行平均或同步批归一化统计信息）。我们认为用户应该完全掌控这些训练细节，而不应将其硬编码到库中。相应的权衡是，你需要在自己的训练脚本中实现这些功能（通常只需两行代码，在应用优化器之前对梯度进行全归约操作），或者替换为明确支持分布式训练的模块（例如 `snt.distribute.CrossReplicaBatchNorm`）。\n\n我们的 [分布式 Cifar-10 示例](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fsonnet\u002Fblob\u002Fv2\u002Fexamples\u002Fdistributed_cifar10.ipynb) 详细介绍了如何使用 Sonnet 进行多 GPU 训练。","# Sonnet 快速上手指南\n\nSonnet 是由 DeepMind 基于 TensorFlow 2 构建的神经网络库，旨在为机器学习研究提供简单、可组合的抽象模块（`snt.Module`）。它不强制绑定训练框架，赋予开发者最大的灵活性。\n\n## 环境准备\n\n*   **系统要求**：支持 Linux、macOS 或 Windows。\n*   **前置依赖**：\n    *   Python 3.7+\n    *   TensorFlow 2.x\n    *   TensorFlow Probability (可选，部分功能需要)\n*   **硬件建议**：推荐使用配备 GPU 或 TPU 的环境以获得最佳性能（如使用 Google Colab 或本地 CUDA 环境）。\n\n> **国内加速提示**：由于官方源位于海外，建议使用国内镜像源安装依赖以提升速度。\n> *   清华源：`https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n> *   阿里源：`https:\u002F\u002Fmirrors.aliyun.com\u002Fpypi\u002Fsimple\u002F`\n\n## 安装步骤\n\n使用 `pip` 安装 TensorFlow 和 Sonnet。推荐在虚拟环境中操作。\n\n### 1. 安装依赖\n```shell\n# 使用国内镜像源加速安装\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple tensorflow tensorflow-probability\npip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple dm-sonnet\n```\n\n### 2. 验证安装\n运行以下 Python 代码确认安装成功：\n```python\nimport tensorflow as tf\nimport sonnet as snt\n\nprint(\"TensorFlow version {}\".format(tf.__version__))\nprint(\"Sonnet version {}\".format(snt.__version__))\n```\n\n## 基本使用\n\nSonnet 的核心概念是 `snt.Module`。你可以直接使用内置模块，也可以继承 `snt.Module` 创建自定义模块。\n\n### 1. 使用内置模块构建 MLP\nSonnet 提供了丰富的预定义模块（如 `snt.Linear`, `snt.Conv2D`）。利用 `snt.Sequential` 可以轻松堆叠网络层。\n\n```python\nimport tensorflow as tf\nimport sonnet as snt\n\n# 定义一个多层感知机 (MLP)\nmlp = snt.Sequential([\n    snt.Linear(1024),\n    tf.nn.relu,\n    snt.Linear(10),\n])\n\n# 调用模块进行前向传播\n# 参数会在第一次调用时根据输入形状自动初始化\nbatch_size = 32\ninput_size = 784\nlogits = mlp(tf.random.normal([batch_size, input_size]))\n\n# 获取可训练参数（用于优化器）\nmodel_parameters = mlp.trainable_variables\n```\n\n### 2. 构建自定义模块\n通过继承 `snt.Module` 类，你可以定义自己的网络层。Sonnet 会自动处理变量作用域、序列化及调试信息展示。\n\n```python\nclass MyLinear(snt.Module):\n    def __init__(self, output_size, name=None):\n        super(MyLinear, self).__init__(name=name)\n        self.output_size = output_size\n\n    @snt.once\n    def _initialize(self, x):\n        # 延迟初始化：根据输入形状创建变量\n        initial_w = tf.random.normal([x.shape[1], self.output_size])\n        self.w = tf.Variable(initial_w, name=\"w\")\n        self.b = tf.Variable(tf.zeros([self.output_size]), name=\"b\")\n\n    def __call__(self, x):\n        self._initialize(x)\n        return tf.matmul(x, self.w) + self.b\n\n# 使用自定义模块\nmod = MyLinear(32)\noutput = mod(tf.ones([batch_size, input_size]))\n\n# 查看模块表示和变量\nprint(repr(mod)) \nprint(mod.variables)\n```\n\n### 下一步\n*   **示例代码**：访问 [GitHub Examples](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fsonnet\u002Ftree\u002Fv2\u002Fexamples) 查看 MNIST 分类、GAN 训练及分布式训练的完整 Notebook。\n*   **文档**：详细 API 参考请参阅 [官方文档](https:\u002F\u002Fsonnet.readthedocs.io\u002F)。","某深度学习团队正在基于 TensorFlow 2 研发一套复杂的强化学习代理模型，需要频繁组合自定义网络层并管理大量状态参数。\n\n### 没有 sonnet 时\n- 开发者需手动编写繁琐的类继承代码来管理变量作用域，稍有不慎就会导致参数命名冲突或泄露。\n- 构建复杂网络时，层层嵌套的函数调用让数据流向难以追踪，调试时无法直观定位某一层的输出异常。\n- 缺乏统一的模块封装标准，团队成员各自为战，导致代码风格割裂，复用他人编写的网络组件极其困难。\n- 每次修改网络结构（如增加批归一化层）都需要重构大量底层逻辑，严重拖慢了算法迭代和实验验证的速度。\n\n### 使用 sonnet 后\n- 利用 `snt.Module` 统一封装逻辑，自动处理参数创建与作用域隔离，彻底消除了手动管理变量的出错风险。\n- 通过 `snt.Sequential` 等组合工具像搭积木一样构建网络，数据流转清晰可见，快速定位并修复了中间层计算错误。\n- 团队基于统一的模块接口开发，轻松将同事写好的奖励预测模块直接嵌入主模型，显著提升了协作效率。\n- 修改网络架构只需调整模块序列或替换单个组件，无需触动底层训练循环，让新想法的验证周期从数天缩短至数小时。\n\nsonnet 通过极简且高内聚的模块化设计，让研究人员从繁琐的工程细节中解放出来，专注于核心算法的创新与探索。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-deepmind_sonnet_18d03525.png","google-deepmind","Google DeepMind","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle-deepmind_06b1dd17.png","",null,"https:\u002F\u002Fwww.deepmind.com\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind",[80,84,88],{"name":81,"color":82,"percentage":83},"Python","#3572A5",96,{"name":85,"color":86,"percentage":87},"Starlark","#76d275",3.8,{"name":89,"color":90,"percentage":91},"Shell","#89e051",0.2,9915,1303,"2026-04-14T10:39:22","Apache-2.0","未说明","非必需，但示例推荐使用 Google Colab (提供 GPU 或 TPU)",{"notes":99,"python":96,"dependencies":100},"Sonnet 是构建在 TensorFlow 2 之上的库，由 DeepMind 开发。它不提供内置的训练框架，用户需自行构建或使用第三方训练脚本。支持通过 pickle、TensorFlow Checkpoint 和 Saved Model 进行序列化。支持分布式训练，但梯度平均和批归一化统计同步等逻辑需用户在训练脚本中自行实现或使用特定的分布式感知模块。",[101,102,103],"tensorflow>=2.0","tensorflow-probability","dm-sonnet",[14],[106,107,108,109,110],"machine-learning","artificial-intelligence","neural-networks","deep-learning","tensorflow","2026-03-27T02:49:30.150509","2026-04-15T10:57:18.059846",[114,119,124,129,134,138,143,147],{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},34164,"是否必须从头编译 TensorFlow 才能使用 Sonnet？","不需要。维护者明确表示不希望强制用户编译 TensorFlow。理想情况下，应同时提供预编译二进制包和源码编译两种选项。用户可以通过 `pip` 直接安装预编译版本，只有在需要特定定制或遇到兼容性问题时才需自行编译。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fissues\u002F5",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},34157,"为什么导入 sonnet 时提示 'module 'sonnet' has no attribute 'AbstractModule''？","这是因为 Sonnet v1 和 v2 的 API 发生了重大变化。在 Sonnet v2 中，`AbstractModule` 已被移除或重命名（通常由 `snt.Module` 替代）。使用 `pip install dm-sonnet` 安装的是 v2 版本，而旧代码（如某些 Kinetics 模型）是基于 v1 编写的，因此无法直接运行。建议联系原模型作者确认是否有适配 v2 的版本，或者在代码中将 `AbstractModule` 替换为 `snt.Module` 并调整相关接口。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fissues\u002F128",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},34158,"在 Ubuntu 上使用 Bazel 构建失败怎么办？","如果是较旧版本的 Ubuntu（如 14.04 LTS），尝试运行 `sudo apt-get dist-upgrade` 升级系统内核和相关依赖，这通常能解决 Bazel 的编译错误。此外，确保使用的是与 TensorFlow 版本匹配的 Bazel 版本。该问题也可能与 Python 3 支持有关，目前新版已支持 Python 3。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fissues\u002F9",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},34159,"在 Fedora 或其他 Linux 发行版上导入 sonnet 时出现 'undefined symbol' 或 '_gen_resampler could not be imported' 错误如何解决？","这通常是由于 TensorFlow 和 Sonnet 编译时的 C++ ABI 不兼容或版本不匹配导致的。解决方法包括：1. 升级 TensorFlow 到更新版本（如 1.1+）；2. 重新编译 TensorFlow 和 Sonnet，确保使用相同的编译器标志；3. 尝试在 Sonnet 源码目录外运行测试脚本，有时在目录内运行会因路径问题导致动态库加载失败。如果问题依旧，检查是否遗漏了 `--config=cuda` 等编译选项（如需 GPU 支持）。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fissues\u002F23",{"id":135,"question_zh":136,"answer_zh":137,"source_url":118},34160,"使用 GCC 6.2 编译 Sonnet 时出现 'internal compiler error: in tsubst_copy' 错误怎么办？","这是 GCC 编译器本身的 Bug，尤其在处理复杂模板实例化时容易触发。虽然升级 GCC 可能无效（因为该 Bug 存在于多个版本中），但可以尝试以下方法：1. 降低优化等级（如移除 `--config=opt`）；2. 使用 Clang 代替 GCC 进行编译；3. 等待官方提供预编译的二进制包以避免自行编译。维护者表示不会强制用户编译 TensorFlow，未来会提供预编译选项。",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},34161,"在 Google Colab 中导入 sonnet 时提示 'cannot import name 'context' from 'tensorflow.python'' 如何解决？","这是由于 TensorFlow 版本更新导致内部模块结构变化，Sonnet 的某些版本尚未完全适配最新的 TensorFlow。解决方法是确保安装的 `dm-sonnet` 和 `tensorflow` 版本兼容。建议在 Colab 中明确指定版本，例如：`!pip install tensorflow==2.x dm-sonnet==2.x`（具体版本号需参考官方兼容性矩阵）。如果问题持续，可尝试从源码安装最新版的 Sonnet 以获取对新版 TensorFlow 的支持。","https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fissues\u002F273",{"id":144,"question_zh":145,"answer_zh":146,"source_url":128},34162,"Sonnet 是否支持 Python 3？","是的，新版 Sonnet 已经支持 Python 3。早期版本可能存在兼容性问题，但维护者已确认 Python 3 支持已完成。如果遇到相关问题，请确保升级到最新的 Sonnet 版本，并检查是否与当前 TensorFlow 版本兼容。",{"id":148,"question_zh":149,"answer_zh":150,"source_url":123},34163,"如何查看当前安装的 Sonnet 版本及其可用模块？","可以在 Python 解释器中运行以下代码来诊断环境：\n```python\nimport sonnet as snt\nprint(dir(snt))\nprint(snt.__version__)\n```\n这将列出所有可用的类和方法以及当前版本号，有助于判断是否安装了正确的版本或是否存在命名变更（如 `AbstractModule` 变为 `Module`）。",[152,157,162,167],{"id":153,"version":154,"summary_zh":155,"released_at":156},264049,"v2.0.2","Sonnet 2 是 Sonnet for TensorFlow 2.0 的重写版本，它基于 `tf.Module` 构建（https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fcommunity\u002Fpull\u002F56），为 TensorFlow 提供了一个简单且对研究人员友好的接口。\n\n自 2.0.1 版本以来的主要变更：\n\n## 变更内容\n\n* #267 修复了在 2.10.0 及以下小版本中被移除的内部 TF 符号的使用问题。（修复 #273）\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fcompare\u002Fv2.0.1...v2.0.2","2024-01-02T11:08:14",{"id":158,"version":159,"summary_zh":160,"released_at":161},264050,"v2.0.1","Sonnet 2 是 Sonnet for TensorFlow 2.0 的重写版本，它基于 `tf.Module` 构建（https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fcommunity\u002Fpull\u002F56），为 TensorFlow 提供了一个简单且对研究者友好的接口。\n\n自 2.0.0 版本以来的主要变更：\n\n* #205 在 Sonnet 2 中添加了受 [JAX](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fjax) 和 [Haiku](https:\u002F\u002Fgithub.com\u002Fdeepmind\u002Fdm-haiku) 启发的函数式 API。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fsonnet\u002Fcompare\u002Fv2.0.0...v2.0.1\n\n（注：Sonnet 2.0.1 已于 2022 年 12 月发布到 PyPI 上（https:\u002F\u002Fpypi.org\u002Fproject\u002Fdm-sonnet\u002F2.0.1\u002F），GitHub 发布则稍后进行，但指向的是已发布的提交。）","2024-01-02T09:16:55",{"id":163,"version":164,"summary_zh":165,"released_at":166},264051,"v2.0.0","Sonnet 2 是对 TensorFlow 2.0 版本的 Sonnet 的重写，它基于 `tf.Module` 构建（tensorflow\u002Fcommunity#56），为 TensorFlow 提供了一个简单且便于研究人员使用的接口。","2020-03-27T10:36:19",{"id":168,"version":169,"summary_zh":170,"released_at":171},264052,"v2.0-beta","Sonnet 2 是对 TensorFlow 2.0 版本的 Sonnet 的重写，它基于 `tf.Module` 构建（tensorflow\u002Fcommunity#56），为 TensorFlow 提供了一个简单且便于研究人员使用的接口。\n\n关闭 #117 和 #123。","2019-09-06T13:45:17"]