[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-google-research--leaf-audio":3,"tool-google-research--leaf-audio":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 真正成长为懂上",143909,2,"2026-04-07T11:33:18",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[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},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":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":78,"owner_url":79,"languages":80,"stars":85,"forks":86,"last_commit_at":87,"license":88,"difficulty_score":10,"env_os":76,"env_gpu":89,"env_ram":90,"env_deps":91,"category_tags":99,"github_topics":77,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":101,"updated_at":102,"faqs":103,"releases":124},5061,"google-research\u002Fleaf-audio","leaf-audio","LEAF is a learnable alternative to audio features such as mel-filterbanks, that can be initialized as an approximation of mel-filterbanks, and then be trained for the task at hand, while using a very small number of parameters.","leaf-audio 是一个可学习的音频前端库，旨在替代传统的固定音频特征提取方法（如梅尔滤波器组）。在传统流程中，音频特征通常是预先设定且不可调整的，这可能无法完美适配特定的下游任务。leaf-audio 通过引入极少量的可训练参数，允许模型在初始化时近似梅尔滤波器组，随后根据具体任务数据进行微调，从而自动学习最优的音频表示方式。\n\n这一设计有效解决了固定特征提取器灵活性不足的问题，有助于提升语音识别、音频分类等任务的性能。leaf-audio 特别适合音频领域的研究人员和开发者使用，尤其是那些希望探索端到端学习架构或优化特征提取环节的专业人士。\n\n其技术亮点在于高度模块化与可定制性：用户不仅可以轻松切换滤波器数量、窗口大小、采样率等参数，还能选择不同类型的压缩函数（如 PCEN 或对数压缩）及初始化策略。此外，除了核心的 LEAF 前端，该库还集成了 SincNet、时域滤波器组等多种经典方案，并提供了基于 TensorFlow\u002FKeras 的完整训练示例，方便用户快速复现论文结果或开展新实验。对于追求高效、灵活音频处理方案的团队来说，leaf-audio 是一个值得尝试的开源选择","leaf-audio 是一个可学习的音频前端库，旨在替代传统的固定音频特征提取方法（如梅尔滤波器组）。在传统流程中，音频特征通常是预先设定且不可调整的，这可能无法完美适配特定的下游任务。leaf-audio 通过引入极少量的可训练参数，允许模型在初始化时近似梅尔滤波器组，随后根据具体任务数据进行微调，从而自动学习最优的音频表示方式。\n\n这一设计有效解决了固定特征提取器灵活性不足的问题，有助于提升语音识别、音频分类等任务的性能。leaf-audio 特别适合音频领域的研究人员和开发者使用，尤其是那些希望探索端到端学习架构或优化特征提取环节的专业人士。\n\n其技术亮点在于高度模块化与可定制性：用户不仅可以轻松切换滤波器数量、窗口大小、采样率等参数，还能选择不同类型的压缩函数（如 PCEN 或对数压缩）及初始化策略。此外，除了核心的 LEAF 前端，该库还集成了 SincNet、时域滤波器组等多种经典方案，并提供了基于 TensorFlow\u002FKeras 的完整训练示例，方便用户快速复现论文结果或开展新实验。对于追求高效、灵活音频处理方案的团队来说，leaf-audio 是一个值得尝试的开源选择。","# LEAF: a LEarnable Audio Frontend\n\n![Overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_leaf-audio_readme_a0d42e817423.png)\n\nLEAF is a learnable alternative to audio features such as mel-filterbanks, that can be initialized as an approximation of mel-filterbanks, and then be trained for the task at hand, while using a very small\nnumber of parameters.\n\nA complete description of the system is available in [our recent ICLR publication](https:\u002F\u002Fopenreview.net\u002Fforum?id=jM76BCb6F9m).\n\n\n## Dependencies\n* Python 3.8\n* [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F)\n* [TensorFlow Datasets](https:\u002F\u002Fwww.tensorflow.org\u002Fdatasets\u002Foverview)\n* [Gin](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fgin-config)\n* [Lingvo](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Flingvo)\n\n## Contents\nThis library contains Tensorflow\u002FKeras code for:\n\n* the LEAF frontend, as well as mel-filterbanks, [SincNet](https:\u002F\u002Farxiv.org\u002Fabs\u002F1808.00158) and [Time-Domain Filterbanks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1711.01161)\n* Keras models for [PANN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1912.10211), [PCEN](https:\u002F\u002Fresearch.google\u002Fpubs\u002Fpub45911\u002F) and [SpecAugment](https:\u002F\u002Farxiv.org\u002Fabs\u002F1904.08779)\n* an example training loop using gin, to train models with various frontends and architectures on tensorflow datasets.\n\n\nLooking for a PyTorch version? Check this [repo](https:\u002F\u002Fgithub.com\u002FSarthakYadav\u002Fleaf-pytorch) (not managed by google-research).\n\n## Installation\nFrom the root directory of the repo, run:\n\n```bash\npip3 install -e .\n```\n\n## Creating a Leaf frontend\nWe provide learnable and fixed frontends as Keras Models. Instantiating `Leaf` with default arguments will build a LEAF frontend with a 25ms window size, a 10ms window stride, sPCEN as compression function and an initialization of filters on the mel-scale, as described in the paper. For convenience, we also propose Time-Domain Filterbanks, SincNet and SincNet+ as particular instantations of `Leaf`, with different layers and initializers.\n\n```python\nimport leaf_audio.frontend as frontend\n\nleaf = frontend.Leaf()\nmelfbanks = frontend.MelFilterbanks()\ntfbanks = frontend.TimeDomainFilterbanks()\nsincnet = frontend.SincNet()\nsincnet_plus = frontend.SincNetPlus()\n```\n\nA frontend takes a batch of waveform sequences as inputs, and outputs a batch of time-frequency representations.\n\n```python\nimport tensorflow as tf\nimport tensorflow_datasets as tfds\n\ndataset = iter(tfds.load('speech_commands', split='train', shuffle_files=True))\n# Audio is in int16, we rescale it to [-1; 1].\naudio_sample = next(dataset)['audio'] \u002F tf.int16.max\n# The frontend expects inputs of shape [B, T] or [B, T, C].\naudio_sample = audio_sample[tf.newaxis, :]\n\nleaf_representation = leaf(audio_sample)\nmelfbanks_representation = melfbanks(audio_sample)\ntfbanks_representation = tfbanks(audio_sample)\nsincnet_representation = sincnet(audio_sample)\nsincnet_plus_representation = sincnet_plus(audio_sample)\n```\n\n![Frontends output](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_leaf-audio_readme_f581eb07638e.png)\n\n## Customizing the frontend architecture\n\nOne can easily build new frontends from LEAF, by changing the number\nof filters, window_size, compression function, sampling rate and so on.\nIn this case, one should instantiate `Leaf` with custom arguments.\nAs an example, the following `custom_leaf` frontend differs from the default LEAF\nby using:\n\n* 64 filters instead of 40,\n* a window size of 32ms instead of 25,\n* an audio sampling rate of 24kHz,\n* a learnable pre-emphasis layer,\n* log-compression instead of PCEN,\n* a non-learnable pooling layer.\n\nAs the initialization depends on the sampling rate, we also need to redefine\n`complex_conv_init`.\n\n```python\nimport functools\nfrom leaf_audio import frontend, initializers\n\nn_filters = 64\nwindow_len = 32\nsample_rate = 24000\npreemp = True\ncompression_fn = functools.partial(frontend.log_compression, log_offset=1e-5)\ncomplex_conv_init = initializers.GaborInit(sample_rate=sample_rate, min_freq=60., max_freq=7800.)\nlearn_pooling=False\ncustom_leaf = frontend.Leaf(learn_pooling=learn_pooling,\n                            n_filters=n_filters,\n                            window_len=window_len,\n                            sample_rate=sample_rate,\n                            preemp=preemp,\n                            compression_fn=compression_fn,\n                            complex_conv_init=complex_conv_init)\n```\n\n## Training audio classification models\n\nWe also provide a basic training library that allows combining a frontend with\na main classification architecture (including PANN), and training it on a classification dataset.\n\nThis library uses Gin: `common.gin` contains the common hyperparameters such as\nthe batch size or the classification architecture. Each frontend then has its own\n`.gin` config file that uses all hyperparameters from `common.gin` and overrides\nthe frontend class. In `leaf_custom.gin` we show how Gin allows to easily change\nhyperparameters of the frontend, as well as the main classification architecture\nand using SpecAugment.\n\nTo train a model on mel-filterbanks:\n\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fmel.gin\n```\n\nor on LEAF:\n\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fleaf.gin\n```\n\n## Reference\nIf you use this repository, please consider citing:\n\n```\n@article{zeghidour2021leaf,\n  title={LEAF: A Learnable Frontend for Audio Classification},\n  author={Zeghidour, Neil and Teboul, Olivier and de Chaumont Quitry, F{\\'e}lix and Tagliasacchi, Marco},\n  journal={ICLR},\n  year={2021}\n}\n```\n\nNote that this is not an officially supported Google product.\n","# LEAF：一种可学习的音频前端\n\n![概述](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_leaf-audio_readme_a0d42e817423.png)\n\nLEAF 是一种可学习的音频特征替代方案，可用于替代梅尔滤波器组等传统特征。它可以初始化为接近梅尔滤波器组的形式，随后针对特定任务进行训练，且仅需极少量的参数。\n\n有关该系统的完整描述，请参阅我们最近发表在 ICLR 上的论文：[链接](https:\u002F\u002Fopenreview.net\u002Fforum?id=jM76BCb6F9m)。\n\n## 依赖项\n* Python 3.8\n* [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F)\n* [TensorFlow 数据集](https:\u002F\u002Fwww.tensorflow.org\u002Fdatasets\u002Foverview)\n* [Gin](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fgin-config)\n* [Lingvo](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Flingvo)\n\n## 内容\n本库包含用于以下内容的 TensorFlow\u002FKeras 代码：\n* LEAF 前端，以及梅尔滤波器组、[SincNet](https:\u002F\u002Farxiv.org\u002Fabs\u002F1808.00158) 和 [时域滤波器组](https:\u002F\u002Farxiv.org\u002Fabs\u002F1711.01161)\n* 用于 [PANN](https:\u002F\u002Farxiv.org\u002Fabs\u002F1912.10211)、[PCEN](https:\u002F\u002Fresearch.google\u002Fpubs\u002Fpub45911\u002F) 和 [SpecAugment](https:\u002F\u002Farxiv.org\u002Fabs\u002F1904.08779) 的 Keras 模型\n* 使用 gin 的示例训练循环，用于在 TensorFlow 数据集上训练采用不同前端和架构的模型。\n\n正在寻找 PyTorch 版本吗？请查看此 [仓库](https:\u002F\u002Fgithub.com\u002FSarthakYadav\u002Fleaf-pytorch)（不由 Google Research 维护）。\n\n## 安装\n从仓库根目录运行以下命令：\n\n```bash\npip3 install -e .\n```\n\n## 创建 Leaf 前端\n我们提供了可学习和固定两种类型的前端，均为 Keras 模型。使用默认参数实例化 `Leaf` 将构建一个窗口大小为 25 毫秒、步长为 10 毫秒、压缩函数为 sPCEN、滤波器按梅尔尺度初始化的 LEAF 前端，如论文所述。为方便起见，我们还提供了时域滤波器组、SincNet 和 SincNet+ 作为 `Leaf` 的特殊实例，具有不同的层和初始化方式。\n\n```python\nimport leaf_audio.frontend as frontend\n\nleaf = frontend.Leaf()\nmelfbanks = frontend.MelFilterbanks()\ntfbanks = frontend.TimeDomainFilterbanks()\nsincnet = frontend.SincNet()\nsincnet_plus = frontend.SincNetPlus()\n```\n\n前端接收一批波形序列作为输入，并输出一批时频表示。\n\n```python\nimport tensorflow as tf\nimport tensorflow_datasets as tfds\n\ndataset = iter(tfds.load('speech_commands', split='train', shuffle_files=True))\n# 音频数据为 int16 格式，我们将其归一化到 [-1; 1]。\naudio_sample = next(dataset)['audio'] \u002F tf.int16.max\n# 前端期望输入形状为 [B, T] 或 [B, T, C]。\naudio_sample = audio_sample[tf.newaxis, :]\n\nleaf_representation = leaf(audio_sample)\nmelfbanks_representation = melfbanks(audio_sample)\ntfbanks_representation = tfbanks(audio_sample)\nsincnet_representation = sincnet(audio_sample)\nsincnet_plus_representation = sincnet_plus(audio_sample)\n```\n\n![前端输出](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_leaf-audio_readme_f581eb07638e.png)\n\n## 自定义前端架构\n用户可以通过调整滤波器数量、窗口大小、压缩函数、采样率等参数，轻松构建新的 LEAF 前端。此时，应使用自定义参数实例化 `Leaf`。例如，以下 `custom_leaf` 前端与默认 LEAF 的区别在于：\n* 使用 64 个滤波器而非 40 个，\n* 窗口大小为 32 毫秒而非 25 毫秒，\n* 音频采样率为 24kHz，\n* 包含可学习的预加重层，\n* 使用对数压缩而非 PCEN，\n* 不包含可学习的池化层。\n\n由于初始化依赖于采样率，我们还需重新定义 `complex_conv_init`。\n\n```python\nimport functools\nfrom leaf_audio import frontend, initializers\n\nn_filters = 64\nwindow_len = 32\nsample_rate = 24000\npreemp = True\ncompression_fn = functools.partial(frontend.log_compression, log_offset=1e-5)\ncomplex_conv_init = initializers.GaborInit(sample_rate=sample_rate, min_freq=60., max_freq=7800.)\nlearn_pooling=False\ncustom_leaf = frontend.Leaf(learn_pooling=learn_pooling,\n                            n_filters=n_filters,\n                            window_len=window_len,\n                            sample_rate=sample_rate,\n                            preemp=preemp,\n                            compression_fn=compression_fn,\n                            complex_conv_init=complex_conv_init)\n```\n\n## 训练音频分类模型\n我们还提供了一个基础训练库，允许将前端与主分类架构（包括 PANN）结合，并在分类数据集上进行训练。\n该库使用 Gin：`common.gin` 包含批量大小、分类架构等通用超参数。每个前端则有自己的 `.gin` 配置文件，它会继承 `common.gin` 中的所有超参数，并覆盖前端类的相关设置。在 `leaf_custom.gin` 中，我们展示了如何使用 Gin 轻松更改前端的超参数，以及主分类架构和 SpecAugment 的配置。\n要训练基于梅尔滤波器组的模型：\n\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fmel.gin\n```\n\n或基于 LEAF 的模型：\n\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fleaf.gin\n```\n\n## 参考文献\n如果您使用本仓库，请考虑引用以下文献：\n\n```\n@article{zeghidour2021leaf,\n  title={LEAF: A Learnable Frontend for Audio Classification},\n  author={Zeghidour, Neil and Teboul, Olivier and de Chaumont Quitry, F{\\'e}lix and Tagliasacchi, Marco},\n  journal={ICLR},\n  year={2021}\n}\n```\n\n请注意，这并非 Google 官方支持的产品。","# LEAF Audio 快速上手指南\n\nLEAF (LEarnable Audio Frontend) 是一个可学习的音频前端，旨在替代传统的梅尔滤波器组（Mel-filterbanks）。它可以初始化为梅尔滤波器的近似值，随后针对特定任务进行训练，同时保持极少的参数量。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux, macOS 或 Windows (需配置好 Python 环境)\n*   **Python 版本**: 3.8\n*   **核心依赖**:\n    *   [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F)\n    *   [TensorFlow Datasets](https:\u002F\u002Fwww.tensorflow.org\u002Fdatasets\u002Foverview)\n    *   [Gin](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fgin-config) (配置管理)\n    *   [Lingvo](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Flingvo) (语音处理工具包)\n\n> **提示**：国内开发者在安装 TensorFlow 等大型依赖时，建议使用清华源或阿里源加速下载：\n> `pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple \u003Cpackage_name>`\n\n## 安装步骤\n\n克隆仓库或直接下载源码后，进入项目根目录，执行以下命令进行可编辑安装：\n\n```bash\npip3 install -e .\n```\n\n## 基本使用\n\nLEAF 提供了多种前端实现（包括 LEAF、Mel-filterbanks、SincNet 等），均以 Keras 模型形式存在。以下是加载音频数据并生成时频表示的最简示例。\n\n### 1. 初始化前端模型\n\n您可以实例化默认的 `Leaf` 前端，或其他变体（如 `MelFilterbanks`, `SincNet` 等）。默认配置包含 25ms 窗口大小、10ms 步长、sPCEN 压缩函数以及基于梅尔尺度的滤波器初始化。\n\n```python\nimport leaf_audio.frontend as frontend\n\n# 初始化不同的音频前端\nleaf = frontend.Leaf()\nmelfbanks = frontend.MelFilterbanks()\ntfbanks = frontend.TimeDomainFilterbanks()\nsincnet = frontend.SincNet()\nsincnet_plus = frontend.SincNetPlus()\n```\n\n### 2. 处理音频数据\n\n前端模型接收形状为 `[B, T]` (批量大小，时间步) 或 `[B, T, C]` 的波形序列，输出对应的时频特征表示。\n\n```python\nimport tensorflow as tf\nimport tensorflow_datasets as tfds\n\n# 加载示例数据集 (Speech Commands)\ndataset = iter(tfds.load('speech_commands', split='train', shuffle_files=True))\n\n# 获取音频样本并将 int16 归一化到 [-1, 1]\naudio_sample = next(dataset)['audio'] \u002F tf.int16.max\n\n# 调整维度以符合前端输入要求 [B, T]\naudio_sample = audio_sample[tf.newaxis, :]\n\n# 生成特征表示\nleaf_representation = leaf(audio_sample)\nmelfbanks_representation = melfbanks(audio_sample)\ntfbanks_representation = tfbanks(audio_sample)\nsincnet_representation = sincnet(audio_sample)\nsincnet_plus_representation = sincnet_plus(audio_sample)\n```\n\n### 进阶：自定义前端架构\n\n您可以通过修改参数轻松构建自定义前端。例如，创建一个拥有 64 个滤波器、32ms 窗口、24kHz 采样率并使用对数压缩的 LEAF 变体：\n\n```python\nimport functools\nfrom leaf_audio import frontend, initializers\n\nn_filters = 64\nwindow_len = 32\nsample_rate = 24000\npreemp = True\n# 使用对数压缩替代默认的 PCEN\ncompression_fn = functools.partial(frontend.log_compression, log_offset=1e-5)\n# 根据新的采样率重新定义初始化器\ncomplex_conv_init = initializers.GaborInit(sample_rate=sample_rate, min_freq=60., max_freq=7800.)\nlearn_pooling=False\n\ncustom_leaf = frontend.Leaf(learn_pooling=learn_pooling,\n                            n_filters=n_filters,\n                            window_len=window_len,\n                            sample_rate=sample_rate,\n                            preemp=preemp,\n                            compression_fn=compression_fn,\n                            complex_conv_init=complex_conv_init)\n```\n\n### 训练模型\n\n项目内置了基于 Gin 配置的简单训练循环。您可以直接运行以下命令开始训练：\n\n**使用梅尔滤波器组训练：**\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fmel.gin\n```\n\n**使用 LEAF 前端训练：**\n```bash\npython3 -m example.main --gin_config=example\u002Fconfigs\u002Fleaf.gin\n```\n\n如需修改超参数或网络架构，可编辑对应的 `.gin` 配置文件。","某语音识别初创团队正在开发一款针对嘈杂工业环境下的设备故障音检测系统，需要从高噪声背景中精准提取微弱的异常音频特征。\n\n### 没有 leaf-audio 时\n- **特征表达能力受限**：团队被迫使用固定的梅尔滤波器组（Mel-filterbanks），其预设的频率分布无法适配工业机器特有的高频尖锐噪音，导致关键故障信号被平滑丢失。\n- **模型调优成本高**：为了弥补前端特征的不足，不得不堆叠更深的后端神经网络来强行学习特征，导致训练时间长达数天且显存占用极高。\n- **泛化性能不佳**：固定参数的前端无法适应不同型号机器的声学差异，在新设备上的误报率居高不下，需人工反复调整预处理参数。\n- **参数量与效率失衡**：尝试引入 SincNet 等可学习前端时，发现其参数量过大，难以部署在边缘端的低功耗芯片上。\n\n### 使用 leaf-audio 后\n- **自适应特征提取**：leaf-audio 以梅尔滤波器为初始值进行微调，自动学习到适合特定机器噪音的滤波器形状，显著提升了微弱故障信号的信噪比。\n- **端到端高效训练**：由于前端参数极少且可联合优化，整体模型收敛速度提升 40%，大幅缩短了从数据准备到模型上线的周期。\n- **场景泛化能力强**：针对不同设备只需微调 leaf-audio 的少量滤波器参数，即可快速迁移模型，无需重新设计整个预处理流程。\n- **轻量化部署**：leaf-audio 在保持高性能的同时维持了极小的参数量，顺利将模型压缩并部署至工厂现场的嵌入式网关中。\n\nleaf-audio 通过将传统固定音频前端转化为“可学习”模块，用极低的计算代价实现了特征提取与下游任务的完美对齐。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle-research_leaf-audio_f581eb07.png","google-research","Google Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle-research_c23b2adf.png","",null,"https:\u002F\u002Fresearch.google","https:\u002F\u002Fgithub.com\u002Fgoogle-research",[81],{"name":82,"color":83,"percentage":84},"Python","#3572A5",100,523,53,"2026-04-02T14:17:52","Apache-2.0","未说明（基于 TensorFlow，通常建议配备支持 CUDA 的 NVIDIA GPU 以加速训练，但 README 未明确具体型号或显存要求）","未说明",{"notes":92,"python":93,"dependencies":94},"该工具主要基于 TensorFlow\u002FKeras 构建。如需 PyTorch 版本，需使用社区维护的非官方仓库。安装时需在项目根目录运行 'pip3 install -e .'。配置管理依赖 Gin 库。该项目并非 Google 官方支持的产品。","3.8",[95,96,97,98],"TensorFlow","TensorFlow Datasets","Gin","Lingvo",[100,14],"音频","2026-03-27T02:49:30.150509","2026-04-07T22:50:57.103345",[104,109,114,119],{"id":105,"question_zh":106,"answer_zh":107,"source_url":108},23008,"运行 leaf_custom 配置时出现 'TypeError: got an unexpected keyword argument series_length' 错误怎么办？","该问题是由于 lingvo 库升级到了 0.9.0 版本导致的兼容性冲突。请拉取项目的最新提交（latest commit），维护者已在最新代码中修复了此问题。如果更新后仍遇到问题，请反馈。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fleaf-audio\u002Fissues\u002F9",{"id":110,"question_zh":111,"answer_zh":112,"source_url":113},23009,"Leaf Audio 是否支持 TensorFlow 2.4 或更高版本？为什么 requirements.txt 中锁定了特定版本？","之前锁定版本（如 tensorflow==2.3.1）是为了兼容旧版 lingvo。现在 lingvo 0.9.0 已支持更新的 TensorFlow 版本。请拉取项目的最新提交，更新后的 Leaf Audio 已兼容 TensorFlow 2.5 及更高版本。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fleaf-audio\u002Fissues\u002F7",{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},23010,"运行命令时出现 'ValueError: No configurable matching reference @ConvNet()' 错误是什么原因？","该错误通常发生在配置文件（如 example\u002Fconfigs\u002Fcommon.gin）中引用了未注册或无法找到的模块 '@ConvNet()'。虽然当前 Issue 暂无官方回复，但常见解决方法是确保所有依赖模块已正确安装，且 gin 配置文件中引用的类路径与实际代码结构一致。检查是否遗漏了导入语句或模型定义文件的加载。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fleaf-audio\u002Fissues\u002F17",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},23011,"训练完成后，模型预测输出总是指向同一个类别（例如第 10 个元素最大值），即使设置了正确的 num_outputs，这是为什么？","这通常表明模型未能有效收敛或存在数据不平衡问题。虽然官方尚未在此 Issue 中给出具体解答，但建议检查以下几点：1. 确认训练数据集的标签分布是否均衡；2. 检查损失函数是否正确配置为分类任务（如使用 softmax 和交叉熵）；3. 尝试调整学习率或增加训练轮数；4. 验证输入数据预处理流程是否与训练时一致。","https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Fleaf-audio\u002Fissues\u002F10",[]]