[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-philipperemy--n-beats":3,"tool-philipperemy--n-beats":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 真正成长为懂上",158594,2,"2026-04-16T23:34:05",[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":77,"owner_email":78,"owner_twitter":72,"owner_website":79,"owner_url":80,"languages":81,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":94,"env_os":95,"env_gpu":96,"env_ram":95,"env_deps":97,"category_tags":104,"github_topics":105,"view_count":32,"oss_zip_url":109,"oss_zip_packed_at":109,"status":17,"created_at":110,"updated_at":111,"faqs":112,"releases":143},8120,"philipperemy\u002Fn-beats","n-beats","Keras\u002FPytorch implementation of N-BEATS: Neural basis expansion analysis for interpretable time series forecasting.","N-BEATS 是一款专注于时间序列预测的开源深度学习框架，提供了基于 Keras 和 PyTorch 的双重实现。它核心解决了传统预测模型在追求高精度时往往牺牲“可解释性”的难题，让用户不仅能获得准确的未来趋势预测，还能清晰理解模型是依据何种基础模式（如趋势项或季节性项）做出的判断。\n\n这款工具特别适合从事数据分析的科研人员、算法工程师以及需要处理时序数据的开发者使用。无论是金融股价分析、电力负荷预测还是零售销量估算，N-BEATS 都能提供强有力的支持。其独特的技术亮点在于创新的“神经基扩展分析”架构，通过堆叠通用块或可解释块，实现了业界领先的预测精度，同时在 M4 竞赛等权威基准测试中表现卓越。\n\n在使用体验上，N-BEATS 兼顾了灵活性与便捷性，支持通过 pip 一键安装，并提供了详尽的代码示例帮助用户快速上手。值得注意的是，目前其 Keras 版本在处理多维输入特征方面更为成熟。如果你正在寻找一个既具备顶尖预测能力，又能让黑盒模型变得透明可信的解决方案，N-BEATS 值得纳入你的技术栈。","## NBEATS\u003Cbr\u002F>Neural basis expansion analysis for interpretable time series forecasting\n\nTensorflow\u002FPytorch implementation | [Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F1905.10437)\n| [Results](https:\u002F\u002Fgithub.com\u002Ffecet\u002FNBeats-M4)\n\n![NBeats CI](https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fworkflows\u002FN%20Beats%20CI\u002Fbadge.svg?branch=master)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_c140cd34c3d7.png\">\u003Cbr\u002F>\n  \u003Ci>Outputs of the generic and interpretable layers of NBEATS\u003C\u002Fi>\n\u003C\u002Fp>\n\n### Installation\n\nIt is possible to install the two backends at the same time.\n\n#### From PyPI\n\nInstall the Tensorflow\u002FKeras backend: `pip install nbeats-keras`\n\n[![NBEATS - Keras - Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_bd8690cdf79a.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fnbeats-keras)\n\nInstall the Pytorch backend: `pip install nbeats-pytorch`\n\n[![NBEATS - PyTorch - Downloads](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_f78f687f0b36.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fnbeats-pytorch)\n\n#### From the sources\n\nInstallation is based on a MakeFile.\n\nCommand to install N-Beats with Keras: `make install-keras`\n\nCommand to install N-Beats with Pytorch: `make install-pytorch`\n\n#### Run on the GPU\n\nThis trick is no longer necessary on the recent versions of Tensorflow.  To force the utilization of the GPU (with the Keras backend),\nrun: `pip uninstall -y tensorflow && pip install tensorflow-gpu`. \n\n### Example\n\nHere is an example to get familiar with both backends. Note that only the Keras backend supports `input_dim>1` at the moment.\n\n```python\nimport warnings\n\nimport numpy as np\n\nfrom nbeats_keras.model import NBeatsNet as NBeatsKeras\nfrom nbeats_pytorch.model import NBeatsNet as NBeatsPytorch\n\nwarnings.filterwarnings(action='ignore', message='Setting attributes')\n\n\ndef main():\n    # https:\u002F\u002Fkeras.io\u002Flayers\u002Frecurrent\u002F\n    # At the moment only Keras supports input_dim > 1. In the original paper, input_dim=1.\n    num_samples, time_steps, input_dim, output_dim = 50_000, 10, 1, 1\n\n    # This example is for both Keras and Pytorch. In practice, choose the one you prefer.\n    for BackendType in [NBeatsKeras, NBeatsPytorch]:\n        # NOTE: If you choose the Keras backend with input_dim>1, you have \n        # to set the value here too (in the constructor).\n        backend = BackendType(\n            backcast_length=time_steps, forecast_length=output_dim,\n            stack_types=(NBeatsKeras.GENERIC_BLOCK, NBeatsKeras.GENERIC_BLOCK),\n            nb_blocks_per_stack=2, thetas_dim=(4, 4), share_weights_in_stack=True,\n            hidden_layer_units=64\n        )\n\n        # Definition of the objective function and the optimizer.\n        backend.compile(loss='mae', optimizer='adam')\n\n        # Definition of the data. The problem to solve is to find f such as | f(x) - y | -> 0.\n        # where f = np.mean.\n        x = np.random.uniform(size=(num_samples, time_steps, input_dim))\n        y = np.mean(x, axis=1, keepdims=True)\n\n        # Split data into training and testing datasets.\n        c = num_samples \u002F\u002F 10\n        x_train, y_train, x_test, y_test = x[c:], y[c:], x[:c], y[:c]\n        test_size = len(x_test)\n\n        # Train the model.\n        print('Training...')\n        backend.fit(x_train, y_train, validation_data=(x_test, y_test), epochs=20, batch_size=128)\n\n        # Save the model for later.\n        backend.save('n_beats_model.h5')\n\n        # Predict on the testing set (forecast).\n        predictions_forecast = backend.predict(x_test)\n        np.testing.assert_equal(predictions_forecast.shape, (test_size, backend.forecast_length, output_dim))\n\n        # Predict on the testing set (backcast).\n        predictions_backcast = backend.predict(x_test, return_backcast=True)\n        np.testing.assert_equal(predictions_backcast.shape, (test_size, backend.backcast_length, output_dim))\n\n        # Load the model.\n        model_2 = BackendType.load('n_beats_model.h5')\n\n        np.testing.assert_almost_equal(predictions_forecast, model_2.predict(x_test))\n\n\nif __name__ == '__main__':\n    main()\n```\n\nBrowse the [examples](examples) for more. It includes Jupyter notebooks.\n\nJupyter notebook: [NBeats.ipynb](examples\u002FNBeats.ipynb): `make run-jupyter`.\n\n\n### Citation\n\n```\n@misc{NBeatsPRemy,\n  author = {Philippe Remy},\n  title = {N-BEATS: Neural basis expansion analysis for interpretable time series forecasting},\n  year = {2020},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats}},\n}\n```\n\n### Contributors\n\nThank you!\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_0cc7a5bf5cdc.png\" \u002F>\n\u003C\u002Fa>\n","## NBEATS\u003Cbr\u002F>用于可解释时间序列预测的神经基扩展分析\n\nTensorFlow\u002FPyTorch 实现 | [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F1905.10437)\n| [结果](https:\u002F\u002Fgithub.com\u002Ffecet\u002FNBeats-M4)\n\n![NBeats CI](https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fworkflows\u002FN%20Beats%20CI\u002Fbadge.svg?branch=master)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_c140cd34c3d7.png\">\u003Cbr\u002F>\n  \u003Ci>NBEATS 的通用层和可解释层的输出\u003C\u002Fi>\n\u003C\u002Fp>\n\n### 安装\n\n可以同时安装两个后端。\n\n#### 从 PyPI\n\n安装 TensorFlow\u002FKeras 后端：`pip install nbeats-keras`\n\n[![NBEATS - Keras - 下载量](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_bd8690cdf79a.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fnbeats-keras)\n\n安装 PyTorch 后端：`pip install nbeats-pytorch`\n\n[![NBEATS - PyTorch - 下载量](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_f78f687f0b36.png)](https:\u002F\u002Fpepy.tech\u002Fproject\u002Fnbeats-pytorch)\n\n#### 从源代码\n\n安装基于 Makefile。\n\n使用 Keras 安装 N-Beats 的命令：`make install-keras`\n\n使用 PyTorch 安装 N-Beats 的命令：`make install-pytorch`\n\n#### 在 GPU 上运行\n\n在 TensorFlow 的最新版本中，此技巧已不再必要。若要强制使用 GPU（使用 Keras 后端），请执行：`pip uninstall -y tensorflow && pip install tensorflow-gpu`。\n\n### 示例\n\n以下示例可以帮助您熟悉这两个后端。请注意，目前只有 Keras 后端支持 `input_dim>1`。\n\n```python\nimport warnings\n\nimport numpy as np\n\nfrom nbeats_keras.model import NBeatsNet as NBeatsKeras\nfrom nbeats_pytorch.model import NBeatsNet as NBeatsPytorch\n\nwarnings.filterwarnings(action='ignore', message='Setting attributes')\n\n\ndef main():\n    # https:\u002F\u002Fkeras.io\u002Flayers\u002Frecurrent\u002F\n    # 目前只有 Keras 支持 input_dim > 1。在原始论文中，input_dim=1。\n    num_samples, time_steps, input_dim, output_dim = 50_000, 10, 1, 1\n\n    # 本示例适用于 Keras 和 PyTorch。实际使用时，请选择您偏好的后端。\n    for BackendType in [NBeatsKeras, NBeatsPytorch]:\n        # 注意：如果您选择使用 input_dim>1 的 Keras 后端，则需要在此处（构造函数中）也设置该值。\n        backend = BackendType(\n            backcast_length=time_steps, forecast_length=output_dim,\n            stack_types=(NBeatsKeras.GENERIC_BLOCK, NBeatsKeras.GENERIC_BLOCK),\n            nb_blocks_per_stack=2, thetas_dim=(4, 4), share_weights_in_stack=True,\n            hidden_layer_units=64\n        )\n\n        # 定义目标函数和优化器。\n        backend.compile(loss='mae', optimizer='adam')\n\n        # 定义数据。要解决的问题是找到 f，使得 | f(x) - y | -> 0。\n        # 其中 f = np.mean。\n        x = np.random.uniform(size=(num_samples, time_steps, input_dim))\n        y = np.mean(x, axis=1, keepdims=True)\n\n        # 将数据分为训练集和测试集。\n        c = num_samples \u002F\u002F 10\n        x_train, y_train, x_test, y_test = x[c:], y[c:], x[:c], y[:c]\n        test_size = len(x_test)\n\n        # 训练模型。\n        print('Training...')\n        backend.fit(x_train, y_train, validation_data=(x_test, y_test), epochs=20, batch_size=128)\n\n        # 保存模型以备后用。\n        backend.save('n_beats_model.h5')\n\n        # 对测试集进行预测（预测）。\n        predictions_forecast = backend.predict(x_test)\n        np.testing.assert_equal(predictions_forecast.shape, (test_size, backend.forecast_length, output_dim))\n\n        # 对测试集进行预测（回溯）。\n        predictions_backcast = backend.predict(x_test, return_backcast=True)\n        np.testing.assert_equal(predictions_backcast.shape, (test_size, backend.backcast_length, output_dim))\n\n        # 加载模型。\n        model_2 = BackendType.load('n_beats_model.h5')\n\n        np.testing.assert_almost_equal(predictions_forecast, model_2.predict(x_test))\n\n\nif __name__ == '__main__':\n    main()\n```\n\n浏览 [examples](examples) 以获取更多内容。其中包含 Jupyter 笔记本。\n\nJupyter 笔记本：[NBeats.ipynb](examples\u002FNBeats.ipynb)：`make run-jupyter`。\n\n### 引用\n\n```\n@misc{NBeatsPRemy,\n  author = {Philippe Remy},\n  title = {N-BEATS: Neural basis expansion analysis for interpretable time series forecasting},\n  year = {2020},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats}},\n}\n```\n\n### 贡献者\n\n感谢！\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_readme_0cc7a5bf5cdc.png\" \u002F>\n\u003C\u002Fa>","# N-BEATS 快速上手指南\n\nN-BEATS（Neural Basis Expansion Analysis）是一种用于可解释时间序列预测的深度学习模型。本项目提供了 TensorFlow\u002FKeras 和 PyTorch 两种后端实现。\n\n## 环境准备\n\n- **操作系统**：Linux, macOS, Windows\n- **Python 版本**：建议 Python 3.7+\n- **依赖框架**：\n  - Keras 后端：需要安装 `tensorflow` 或 `tensorflow-gpu`\n  - PyTorch 后端：需要安装 `torch`\n- **GPU 支持**：若需使用 GPU 加速，请确保已安装对应的 CUDA 驱动及 GPU 版本的深度学习框架。\n\n## 安装步骤\n\n你可以通过 PyPI 直接安装，也可以从源码安装。\n\n### 方式一：通过 PyPI 安装（推荐）\n\n根据你需要的后端选择安装命令：\n\n```bash\n# 安装 Keras\u002FTensorFlow 后端\npip install nbeats-keras\n\n# 安装 PyTorch 后端\npip install nbeats-pytorch\n```\n\n> **提示**：国内用户可使用清华或阿里镜像源加速安装：\n> ```bash\n> pip install nbeats-keras -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> pip install nbeats-pytorch -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n### 方式二：从源码安装\n\n如果你克隆了仓库，可以使用 Makefile 进行安装：\n\n```bash\n# 安装 Keras 版本\nmake install-keras\n\n# 安装 PyTorch 版本\nmake install-pytorch\n```\n\n### GPU 配置说明\n\n对于较新版本的 TensorFlow，通常无需额外操作即可识别 GPU。若需强制使用 GPU 版本（旧版环境），可执行：\n\n```bash\npip uninstall -y tensorflow && pip install tensorflow-gpu\n```\n\n## 基本使用\n\n以下示例展示了如何同时使用 Keras 和 PyTorch 后端构建、训练并预测 N-BEATS 模型。\n\n> **注意**：目前仅 Keras 后端支持 `input_dim > 1`（多变量输入），PyTorch 后端暂仅支持单变量。\n\n```python\nimport warnings\nimport numpy as np\n\nfrom nbeats_keras.model import NBeatsNet as NBeatsKeras\nfrom nbeats_pytorch.model import NBeatsNet as NBeatsPytorch\n\nwarnings.filterwarnings(action='ignore', message='Setting attributes')\n\n\ndef main():\n    # 参数设置\n    num_samples, time_steps, input_dim, output_dim = 50_000, 10, 1, 1\n\n    # 遍历两种后端进行演示（实际使用时任选其一）\n    for BackendType in [NBeatsKeras, NBeatsPytorch]:\n        # 初始化模型\n        backend = BackendType(\n            backcast_length=time_steps, \n            forecast_length=output_dim,\n            stack_types=(NBeatsKeras.GENERIC_BLOCK, NBeatsKeras.GENERIC_BLOCK),\n            nb_blocks_per_stack=2, \n            thetas_dim=(4, 4), \n            share_weights_in_stack=True,\n            hidden_layer_units=64\n        )\n\n        # 编译模型\n        backend.compile(loss='mae', optimizer='adam')\n\n        # 生成模拟数据 (目标：预测输入序列的均值)\n        x = np.random.uniform(size=(num_samples, time_steps, input_dim))\n        y = np.mean(x, axis=1, keepdims=True)\n\n        # 划分训练集和测试集\n        c = num_samples \u002F\u002F 10\n        x_train, y_train, x_test, y_test = x[c:], y[c:], x[:c], y[:c]\n        test_size = len(x_test)\n\n        # 训练模型\n        print('Training...')\n        backend.fit(x_train, y_train, validation_data=(x_test, y_test), epochs=20, batch_size=128)\n\n        # 保存模型\n        backend.save('n_beats_model.h5')\n\n        # 预测未来值 (Forecast)\n        predictions_forecast = backend.predict(x_test)\n        \n        # 预测历史重构值 (Backcast)\n        predictions_backcast = backend.predict(x_test, return_backcast=True)\n\n        # 加载模型并验证\n        model_2 = BackendType.load('n_beats_model.h5')\n        np.testing.assert_almost_equal(predictions_forecast, model_2.predict(x_test))\n        \n        print(f\"{BackendType.__name__} completed successfully.\")\n\n\nif __name__ == '__main__':\n    main()\n```\n\n更多详细用例和 Jupyter Notebook 教程请参考项目仓库中的 `examples` 目录。运行 Notebook 命令：\n\n```bash\nmake run-jupyter\n```","某大型连锁零售企业的供应链团队正利用历史销售数据，构建自动化系统以预测未来两周各门店的商品需求量，从而优化库存周转。\n\n### 没有 n-beats 时\n- **预测黑盒难解释**：传统深度学习模型（如 LSTM）虽能输出预测值，但无法告知业务方“为何预测下周销量激增”，导致采购经理不敢完全信任自动生成的订单建议。\n- **趋势与周期混为一谈**：现有模型难以将数据的长期增长趋势与季节性波动拆解分析，一旦遇到促销活动或突发节假日，模型容易误判整体走势。\n- **调参试错成本高**：为了平衡拟合度与泛化能力，数据科学家需花费数周时间手动调整网络结构和超参数，且往往只能在精度和可解释性之间二选一。\n- **多框架迁移困难**：团队内部既有 TensorFlow 老项目又有 PyTorch 新研究，缺乏统一架构导致算法复用率低，维护两套代码库耗费大量精力。\n\n### 使用 n-beats 后\n- **白盒化归因分析**：n-beats 独有的基展开机制能直接输出“趋势项”和“季节项”分量，清晰展示销量变化是由季节性因素驱动还是由突发趋势主导，让业务决策有据可依。\n- **结构化特征解耦**：模型自动将时间序列分解为可解释的基底函数，精准识别出促销带来的短期脉冲与年度周期的长期影响，显著提升了特殊场景下的预测鲁棒性。\n- **开箱即用的最优架构**：无需繁琐的结构搜索，n-beats 预设的堆叠块结构在 M4 竞赛级数据集上已验证有效，团队将模型开发周期从数周缩短至几天。\n- **双后端灵活部署**：借助 n-beats 同时支持 Keras 和 PyTorch 的特性，团队无缝整合了原有技术栈，既保留了旧系统的稳定性，又引入了新框架的训练效率。\n\nn-beats 通过打破时间序列预测的“黑盒”困境，让高精度预测结果变得透明可信，真正实现了数据智能与业务逻辑的深度融合。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fphilipperemy_n-beats_c140cd34.png","philipperemy","Philippe Rémy","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fphilipperemy_ab4d68d0.jpg","From Paris to Bangkok via London, Tokyo, LA. Ex @ImperialCollegeLondon. Maths, Stats, Machine Learning.   🏄 🎲 🎱 Co Founder of @skysense, an AI startup.","Imperial College London","Earth","premy.enseirb@gmail.com","philipperemy.github.io\u002Fme","https:\u002F\u002Fgithub.com\u002Fphilipperemy",[82,86],{"name":83,"color":84,"percentage":85},"Python","#3572A5",96.9,{"name":87,"color":88,"percentage":89},"Makefile","#427819",3.1,902,168,"2026-04-15T22:03:28","MIT",1,"未说明","非必需。若使用 Keras 后端需 GPU 加速，需安装 tensorflow-gpu（具体显卡型号、显存及 CUDA 版本未说明）；新版 TensorFlow 默认支持 GPU。",{"notes":98,"python":95,"dependencies":99},"该工具提供 Keras (TensorFlow) 和 PyTorch 两种后端，可通过 pip 分别安装 'nbeats-keras' 或 'nbeats-pytorch'。目前仅 Keras 后端支持输入维度大于 1 (input_dim > 1) 的情况，PyTorch 后端在示例中仅展示了 input_dim=1 的用法。若需在旧版 TensorFlow 中强制使用 GPU，需卸载 tensorflow 并安装 tensorflow-gpu。",[100,101,102,103],"tensorflow","keras","pytorch","numpy",[14],[102,106,107,108],"series-forecasting","deep-learning","neural-networks",null,"2026-03-27T02:49:30.150509","2026-04-17T08:25:56.963905",[113,118,123,128,133,138],{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},36329,"N-BEATS 模型是否支持添加外生变量（Exogenous Variables）或回归量？","是的，项目已经合并了支持外生变量的功能。您可以参考最新的代码提交来获取具体实现细节：\nhttps:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fcommit\u002Ff89f81f4cd60c206e0862d798b83d83ac849220e\n这允许像 Statsmodels 的 SARIMAX 或 Facebook Prophet 那样引入额外的回归特征。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F4",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},36328,"如何绘制论文中提到的“季节项”和“趋势项”分解图？","请参考版本 1.8.0 及以上，并查看官方提供的可解释性示例代码来生成图表：\nhttps:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fblob\u002Fmaster\u002Fexamples\u002Finterpretable_example.py\n该脚本可以复现论文第 28 页所示的季节性和趋势分解效果。目前主要支持 Keras 实现，PyTorch 版本的绘图功能可能需要自行适配。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F69",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},36327,"如何在 Mac M1 芯片上解决 TensorFlow 2.5.0+ 的安装依赖冲突问题？","在 Mac M1 上安装时，如果 pip 无法自动解决依赖冲突，可以尝试以下方法：\n1. 使用 Rosetta 终端运行安装命令。\n2. 手动安装：将 `n-beats_keras` 目录添加到 Python 路径中，并在虚拟环境中运行单元测试。确保已安装 `tensorflow-metal` 和 `tensorflow-macos` 及其依赖项。\n3. 尝试升级包：运行 `pip install nbeats-keras --upgrade`。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F65",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},36330,"PyTorch 实现的 GenericBlock 模块中，输出层是否应该包含 ReLU 激活函数或偏置项（Bias）？","根据原始论文的公式 (1) 修正如下：\n1. θ^b 和 θ^f 的输出不应包含 ReLU 激活函数，应使用线性函数（Linear function）。此问题已在后续提交中修复。\n2. 用于生成回溯值（backcast）和预测值（forecast）的 g^b 和 g^f 函数如果是通过 `torch.nn.Linear` 实现，理论上不应包含偏置项（bias=False），因为它们是用于缩放基向量的系数。但在实际代码讨论中，维护者确认保留 `bias=True` 也是可行的配置，具体取决于实现细节。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F52",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},36331,"在复现 M4 数据集结果时，随着频率和回溯长度增加，模型输出值过大且 sMAPE 损失停滞不前，如何解决？","这是一个已知问题，通常由输入尺寸过大导致数值不稳定引起。维护者已在代码库中修复了此问题。\n请拉取最新代码或查看以下修复提交：\nhttps:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fcommit\u002Ffb1f6127c5030eaecf3b647c349b2c6c7d12cbbf\n确保您的 sMAPE 损失函数实现与修复后的版本一致，特别是关于掩码（mask）和权重计算的部分。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F57",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},36332,"是否可以使用包含多个自变量的 Pandas DataFrame 进行训练？","是的，N-BEATS 支持多变量输入分析（例如股票市场数据中包含多个参数作为输入变量，一个目标变量）。\n如果遇到安装或运行问题，请首先尝试升级包到最新版本：\n```bash\npip install nbeats-keras --upgrade\n```\n确保数据预处理符合模型输入的维度要求。","https:\u002F\u002Fgithub.com\u002Fphilipperemy\u002Fn-beats\u002Fissues\u002F60",[]]