[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-zalandoresearch--pytorch-ts":3,"tool-zalandoresearch--pytorch-ts":64},[4,17,27,35,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[13,14,15,43],"视频",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":23,"last_commit_at":50,"category_tags":51,"status":16},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",[13,26],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":23,"last_commit_at":58,"category_tags":59,"status":16},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",[14,60,43,61,15,62,26,13,63],"数据工具","插件","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":79,"owner_website":81,"owner_url":82,"languages":83,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":23,"env_os":92,"env_gpu":93,"env_ram":92,"env_deps":94,"category_tags":103,"github_topics":104,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":111,"updated_at":112,"faqs":113,"releases":143},4171,"zalandoresearch\u002Fpytorch-ts","pytorch-ts","PyTorch based Probabilistic Time Series forecasting framework based on GluonTS backend","pytorch-ts 是一个基于 PyTorch 构建的概率时间序列预测框架。它旨在解决传统预测模型难以量化未来不确定性的痛点，不仅能给出预测值，还能提供预测结果的概率分布，帮助用户评估风险。\n\n该工具巧妙地将 GluonTS 成熟的数据加载、转换及回测后端能力，与 PyTorch 灵活的深度学习模型相结合。这使得用户能够直接利用 PyTorch 生态中先进的算法（如 DeepAR），在 GPU 上高效训练和部署高精度的时间序列模型。从代码示例可见，pytorch-ts 提供了简洁的 API，只需少量代码即可完成从数据准备、模型训练到未来趋势预测的全流程。\n\npytorch-ts 特别适合熟悉 Python 的开发者、数据科学家以及从事时序分析的研究人员使用。无论是需要预测股票波动、电商销量，还是监控服务器流量，只要涉及带有不确定性的连续数据预测，它都能提供强有力的支持。其独特的技术亮点在于“强强联合”：既保留了 GluonTS 在数据处理上的专业性，又释放了 PyTorch 在模型定制和加速计算上的潜力，是连接理论研究与工业落地的实用桥梁。","# PyTorchTS\n\nPyTorchTS is a [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch) Probabilistic Time Series forecasting framework which provides state of the art PyTorch time series models by utilizing [GluonTS](https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fgluon-ts) as its back-end API and for loading, transforming and back-testing time series data sets.\n\n## Installation\n\n```\n$ pip3 install pytorchts\n```\n\n## Quick start\n\nHere we highlight the the API changes via the GluonTS README.\n\n```python\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport torch\n\nfrom gluonts.dataset.common import ListDataset\nfrom gluonts.dataset.util import to_pandas\n\nfrom pts.model.deepar import DeepAREstimator\nfrom pts import Trainer\n```\n\nThis simple example illustrates how to train a model on some data, and then use it to make predictions. As a first step, we need to collect some data: in this example we will use the volume of tweets mentioning the AMZN ticker symbol.\n\n```python\nurl = \"https:\u002F\u002Fraw.githubusercontent.com\u002Fnumenta\u002FNAB\u002Fmaster\u002Fdata\u002FrealTweets\u002FTwitter_volume_AMZN.csv\"\ndf = pd.read_csv(url, header=0, index_col=0, parse_dates=True)\n```\n\nThe first 100 data points look like follows:\n\n```python\ndf[:100].plot(linewidth=2)\nplt.grid(which='both')\nplt.show()\n```\n\n![png](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzalandoresearch_pytorch-ts_readme_002e18c00ba9.png)\n\n\nWe can now prepare a training dataset for our model to train on. Datasets are essentially iterable collections of dictionaries: each dictionary represents a time series with possibly associated features. For this example, we only have one entry, specified by the `\"start\"` field which is the timestamp of the first data point, and the `\"target\"` field containing time series data. For training, we will use data up to midnight on April 5th, 2015.\n\n\n```python\ntraining_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-05 00:00:00\"]}],\n    freq = \"5min\"\n)\n```\n\nA forecasting model is a *predictor* object. One way of obtaining predictors is by training a correspondent estimator. Instantiating an estimator requires specifying the frequency of the time series that it will handle, as well as the number of time steps to predict. In our example we're using 5 minutes data, so `req=\"5min\"`, and we will train a model to predict the next hour, so `prediction_length=12`. The input to the model will be a vector of size `input_size=43` at each time point.  We also specify some minimal training options in particular training on a `device` for `epoch=10`.\n\n\n```python\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nestimator = DeepAREstimator(freq=\"5min\",\n                            prediction_length=12,\n                            input_size=19,\n                            trainer=Trainer(epochs=10,\n                                            device=device))\npredictor = estimator.train(training_data=training_data, num_workers=4)\n```\n```\n    45it [00:01, 37.60it\u002Fs, avg_epoch_loss=4.64, epoch=0]\n    48it [00:01, 39.56it\u002Fs, avg_epoch_loss=4.2, epoch=1] \n    45it [00:01, 38.11it\u002Fs, avg_epoch_loss=4.1, epoch=2] \n    43it [00:01, 36.29it\u002Fs, avg_epoch_loss=4.05, epoch=3]\n    44it [00:01, 35.98it\u002Fs, avg_epoch_loss=4.03, epoch=4]\n    48it [00:01, 39.48it\u002Fs, avg_epoch_loss=4.01, epoch=5]\n    48it [00:01, 38.65it\u002Fs, avg_epoch_loss=4, epoch=6]   \n    46it [00:01, 37.12it\u002Fs, avg_epoch_loss=3.99, epoch=7]\n    48it [00:01, 38.86it\u002Fs, avg_epoch_loss=3.98, epoch=8]\n    48it [00:01, 39.49it\u002Fs, avg_epoch_loss=3.97, epoch=9]\n```\n\nDuring training, useful information about the progress will be displayed. To get a full overview of the available options, please refer to the source code of `DeepAREstimator` (or other estimators) and `Trainer`.\n\nWe're now ready to make predictions: we will forecast the hour following the midnight on April 15th, 2015.\n\n\n```python\ntest_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-15 00:00:00\"]}],\n    freq = \"5min\"\n)\n```\n\n\n```python\nfor test_entry, forecast in zip(test_data, predictor.predict(test_data)):\n    to_pandas(test_entry)[-60:].plot(linewidth=2)\n    forecast.plot(color='g', prediction_intervals=[50.0, 90.0])\nplt.grid(which='both')\n```\n\n![png](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzalandoresearch_pytorch-ts_readme_0b68d8036a09.png)\n\n\nNote that the forecast is displayed in terms of a probability distribution: the shaded areas represent the 50% and 90% prediction intervals, respectively, centered around the median (dark green line).\n\n\n## Development\n\n```\npip install -e .\npytest test\n```\n\n## Citing\n\nTo cite this repository:\n\n```tex\n@software{pytorchgithub,\n    author = {Kashif Rasul},\n    title = {{P}yTorch{TS}},\n    url = {https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts},\n    version = {0.6.x},\n    year = {2021},\n}\n```\n\n## Scientific Article\n\nWe have implemented the following model using this framework:\n\n* [Multi-variate Probabilistic Time Series Forecasting via Conditioned Normalizing Flows](https:\u002F\u002Farxiv.org\u002Fabs\u002F2002.06103)\n```tex\n@INPROCEEDINGS{rasul2020tempflow,\n  author = {Kashif Rasul and  Abdul-Saboor Sheikh and  Ingmar Schuster and Urs Bergmann and Roland Vollgraf},\n  title = {{M}ultivariate {P}robabilistic {T}ime {S}eries {F}orecasting via {C}onditioned {N}ormalizing {F}lows},\n  year = {2021},\n  url = {https:\u002F\u002Fopenreview.net\u002Fforum?id=WiGQBFuVRv},\n  booktitle = {International Conference on Learning Representations 2021},\n}\n```\n\n* [Autoregressive Denoising Diffusion Models for Multivariate Probabilistic Time Series Forecasting\n](http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a.html)\n```tex\n@InProceedings{pmlr-v139-rasul21a,\n  title = \t {{A}utoregressive {D}enoising {D}iffusion {M}odels for {M}ultivariate {P}robabilistic {T}ime {S}eries {F}orecasting},\n  author =       {Rasul, Kashif and Seward, Calvin and Schuster, Ingmar and Vollgraf, Roland},\n  booktitle = \t {Proceedings of the 38th International Conference on Machine Learning},\n  pages = \t {8857--8868},\n  year = \t {2021},\n  editor = \t {Meila, Marina and Zhang, Tong},\n  volume = \t {139},\n  series = \t {Proceedings of Machine Learning Research},\n  month = \t {18--24 Jul},\n  publisher =    {PMLR},\n  pdf = \t {http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a\u002Frasul21a.pdf},\n  url = \t {http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a.html},\n}\n```\n\n* [Probabilistic Time Series Forecasting with Implicit Quantile Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F2107.03743)\n```tex\n@misc{gouttes2021probabilistic,\n      title={{P}robabilistic {T}ime {S}eries {F}orecasting with {I}mplicit {Q}uantile {N}etworks}, \n      author={Adèle Gouttes and Kashif Rasul and Mateusz Koren and Johannes Stephan and Tofigh Naghibi},\n      year={2021},\n      eprint={2107.03743},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG}\n}\n```\n","# PyTorchTS\n\nPyTorchTS 是一个基于 [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch) 的概率时间序列预测框架，它利用 [GluonTS](https:\u002F\u002Fgithub.com\u002Fawslabs\u002Fgluon-ts) 作为其后端 API，并用于加载、转换和回测时间序列数据集，从而提供最先进的 PyTorch 时间序列模型。\n\n## 安装\n\n```\n$ pip3 install pytorchts\n```\n\n## 快速入门\n\n下面我们通过 GluonTS 的 README 来展示 API 的变化。\n\n```python\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport torch\n\nfrom gluonts.dataset.common import ListDataset\nfrom gluonts.dataset.util import to_pandas\n\nfrom pts.model.deepar import DeepAREstimator\nfrom pts import Trainer\n```\n\n这个简单的示例说明了如何在一些数据上训练模型，然后使用该模型进行预测。首先，我们需要收集一些数据：在这个例子中，我们将使用提及 AMZN 股票代码的推文数量。\n\n```python\nurl = \"https:\u002F\u002Fraw.githubusercontent.com\u002Fnumenta\u002FNAB\u002Fmaster\u002Fdata\u002FrealTweets\u002FTwitter_volume_AMZN.csv\"\ndf = pd.read_csv(url, header=0, index_col=0, parse_dates=True)\n```\n\n前 100 个数据点如下所示：\n\n```python\ndf[:100].plot(linewidth=2)\nplt.grid(which='both')\nplt.show()\n```\n\n![png](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzalandoresearch_pytorch-ts_readme_002e18c00ba9.png)\n\n\n现在我们可以为模型准备一个训练数据集。数据集本质上是字典的可迭代集合：每个字典代表一个时间序列，可能附带相关特征。对于这个示例，我们只有一个条目，由 `\"start\"` 字段指定，即第一个数据点的时间戳，以及包含时间序列数据的 `\"target\"` 字段。为了训练，我们将使用截至 2015 年 4 月 5 日午夜的数据。\n\n\n```python\ntraining_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-05 00:00:00\"]}],\n    freq = \"5min\"\n)\n```\n\n预测模型是一个 *预测器* 对象。获取预测器的一种方法是训练相应的估计器。实例化估计器需要指定它将处理的时间序列的频率，以及要预测的时间步数。在我们的示例中，我们使用的是 5 分钟的数据，因此 `req=\"5min\"`，我们将训练一个模型来预测接下来的 1 小时，所以 `prediction_length=12`。模型的输入将在每个时间点是一个大小为 `input_size=43` 的向量。我们还指定了几个最小的训练选项，特别是使用 `device` 进行训练，训练 `epoch=10` 次。\n\n\n```python\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nestimator = DeepAREstimator(freq=\"5min\",\n                            prediction_length=12,\n                            input_size=19,\n                            trainer=Trainer(epochs=10,\n                                            device=device))\npredictor = estimator.train(training_data=training_data, num_workers=4)\n```\n```\n    45it [00:01, 37.60it\u002Fs, avg_epoch_loss=4.64, epoch=0]\n    48it [00:01, 39.56it\u002Fs, avg_epoch_loss=4.2, epoch=1] \n    45it [00:01, 38.11it\u002Fs, avg_epoch_loss=4.1, epoch=2] \n    43it [00:01, 36.29it\u002Fs, avg_epoch_loss=4.05, epoch=3]\n    44it [00:01, 35.98it\u002Fs, avg_epoch_loss=4.03, epoch=4]\n    48it [00:01, 39.48it\u002Fs, avg_epoch_loss=4.01, epoch=5]\n    48it [00:01, 38.65it\u002Fs, avg_epoch_loss=4, epoch=6]   \n    46it [00:01, 37.12it\u002Fs, avg_epoch_loss=3.99, epoch=7]\n    48it [00:01, 38.86it\u002Fs, avg_epoch_loss=3.98, epoch=8]\n    48it [00:01, 39.49it\u002Fs, avg_epoch_loss=3.97, epoch=9]\n```\n\n在训练过程中，会显示有关进度的有用信息。要全面了解可用选项，请参阅 `DeepAREstimator`（或其他估计器）和 `Trainer` 的源代码。\n\n现在我们已经准备好进行预测了：我们将预测 2015 年 4 月 15 日午夜之后的一小时。\n\n\n```python\ntest_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-15 00:00:00\"]}],\n    freq = \"5min\"\n)\n```\n\n\n```python\nfor test_entry, forecast in zip(test_data, predictor.predict(test_data)):\n    to_pandas(test_entry)[-60:].plot(linewidth=2)\n    forecast.plot(color='g', prediction_intervals=[50.0, 90.0])\nplt.grid(which='both')\n```\n\n![png](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzalandoresearch_pytorch-ts_readme_0b68d8036a09.png)\n\n\n请注意，预测是以概率分布的形式显示的：阴影区域分别表示以中位数（深绿色线）为中心的 50% 和 90% 预测区间。\n\n\n## 开发\n\n```\npip install -e .\npytest test\n```\n\n## 引用\n\n要引用此仓库：\n\n```tex\n@software{pytorchgithub,\n    author = {Kashif Rasul},\n    title = {{P}yTorch{TS}},\n    url = {https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts},\n    version = {0.6.x},\n    year = {2021},\n}\n```\n\n## 科学论文\n\n我们使用此框架实现了以下模型：\n\n* [基于条件归一化流的多变量概率时间序列预测](https:\u002F\u002Farxiv.org\u002Fabs\u002F2002.06103)\n```tex\n@INPROCEEDINGS{rasul2020tempflow,\n  author = {Kashif Rasul and  Abdul-Saboor Sheikh and  Ingmar Schuster and Urs Bergmann and Roland Vollgraf},\n  title = {{M}ultivariate {P}robabilistic {T}ime {S}eries {F}orecasting via {C}onditioned {N}ormalizing {F}lows},\n  year = {2021},\n  url = {https:\u002F\u002Fopenreview.net\u002Fforum?id=WiGQBFuVRv},\n  booktitle = {International Conference on Learning Representations 2021},\n}\n```\n\n* [自回归去噪扩散模型用于多变量概率时间序列预测](http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a.html)\n```tex\n@InProceedings{pmlr-v139-rasul21a,\n  title = \t {{A}utoregressive {D}enoising {D}iffusion {M}odels for {M}ultivariate {P}robabilistic {T}ime {S}eries {F}orecasting},\n  author =       {Rasul, Kashif and Seward, Calvin and Schuster, Ingmar and Vollgraf, Roland},\n  booktitle = \t {Proceedings of the 38th International Conference on Machine Learning},\n  pages = \t {8857--8868},\n  year = \t {2021},\n  editor = \t {Meila, Marina and Zhang, Tong},\n  volume = \t {139},\n  series = \t {Proceedings of Machine Learning Research},\n  month = \t {18--24 Jul},\n  publisher =    {PMLR},\n  pdf = \t {http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a\u002Frasul21a.pdf},\n  url = \t {http:\u002F\u002Fproceedings.mlr.press\u002Fv139\u002Frasul21a.html},\n}\n```\n\n* [基于隐式分位数网络的概率时间序列预测](https:\u002F\u002Farxiv.org\u002Fabs\u002F2107.03743)\n```tex\n@misc{gouttes2021probabilistic,\n      title={{P}robabilistic {T}ime {S}eries {F}orecasting with {I}mplicit {Q}uantile {N}etworks}, \n      author={Adèle Gouttes and Kashif Rasul and Mateusz Koren and Johannes Stephan and Tofigh Naghibi},\n      year={2021},\n      eprint={2107.03743},\n      archivePrefix={arXiv},\n      primaryClass={cs.LG}\n}\n```","# PyTorchTS 快速上手指南\n\nPyTorchTS 是一个基于 PyTorch 的概率时间序列预测框架。它利用 GluonTS 作为后端 API 来处理数据的加载、转换和回测，同时提供先进的 PyTorch 时间序列模型（如 DeepAR）。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：推荐 Python 3.7 及以上\n*   **核心依赖**：\n    *   PyTorch (需预先安装)\n    *   GluonTS\n    *   Pandas, Matplotlib (用于数据处理和可视化)\n*   **硬件加速**（可选）：如需使用 GPU 加速训练，请确保已安装对应的 CUDA 版本及 `torch` GPU 版本。\n\n> **国内加速建议**：\n> 如果下载依赖较慢，建议使用国内镜像源安装基础依赖：\n> ```bash\n> pip install torch pandas matplotlib -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n> ```\n\n## 安装步骤\n\n使用 pip 直接安装 PyTorchTS：\n\n```bash\npip3 install pytorchts\n```\n\n若需使用国内镜像源加速安装：\n\n```bash\npip3 install pytorchts -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n以下示例演示了如何加载数据、训练一个 DeepAR 模型并进行概率预测。\n\n### 1. 导入依赖与准备数据\n\n首先导入必要的库，并加载示例数据（亚马逊股票相关的推文数量）。\n\n```python\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport torch\n\nfrom gluonts.dataset.common import ListDataset\nfrom gluonts.dataset.util import to_pandas\n\nfrom pts.model.deepar import DeepAREstimator\nfrom pts import Trainer\n\n# 加载数据\nurl = \"https:\u002F\u002Fraw.githubusercontent.com\u002Fnumenta\u002FNAB\u002Fmaster\u002Fdata\u002FrealTweets\u002FTwitter_volume_AMZN.csv\"\ndf = pd.read_csv(url, header=0, index_col=0, parse_dates=True)\n\n# 可视化前 100 个数据点\ndf[:100].plot(linewidth=2)\nplt.grid(which='both')\nplt.show()\n```\n\n### 2. 构建训练数据集\n\n将数据转换为 `ListDataset` 格式。本例使用 2015 年 4 月 5 日之前的数据进行训练，频率为 5 分钟。\n\n```python\ntraining_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-05 00:00:00\"]}],\n    freq=\"5min\"\n)\n```\n\n### 3. 定义模型与训练\n\n实例化 `DeepAREstimator`。设置预测长度为 12（即预测未来 1 小时，因为频率是 5 分钟），并指定训练设备（自动检测 CUDA）。\n\n```python\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nestimator = DeepAREstimator(freq=\"5min\",\n                            prediction_length=12,\n                            input_size=19,\n                            trainer=Trainer(epochs=10,\n                                            device=device))\n\n# 开始训练\npredictor = estimator.train(training_data=training_data, num_workers=4)\n```\n\n训练过程中会输出每个 epoch 的损失情况，例如：\n```text\n45it [00:01, 37.60it\u002Fs, avg_epoch_loss=4.64, epoch=0]\n...\n48it [00:01, 39.49it\u002Fs, avg_epoch_loss=3.97, epoch=9]\n```\n\n### 4. 进行预测与可视化\n\n使用训练好的 `predictor` 对测试数据（截至 2015 年 4 月 15 日）进行预测，并绘制结果。预测结果包含概率分布，图中阴影部分分别表示 50% 和 90% 的置信区间。\n\n```python\ntest_data = ListDataset(\n    [{\"start\": df.index[0], \"target\": df.value[:\"2015-04-15 00:00:00\"]}],\n    freq=\"5min\"\n)\n\nfor test_entry, forecast in zip(test_data, predictor.predict(test_data)):\n    to_pandas(test_entry)[-60:].plot(linewidth=2)\n    forecast.plot(color='g', prediction_intervals=[50.0, 90.0])\n\nplt.grid(which='both')\nplt.show()\n```","某电商数据团队需要基于历史流量数据，精准预测未来一小时各商品类目的访问量，以动态调整服务器资源分配。\n\n### 没有 pytorch-ts 时\n- **模型复现困难**：团队想使用业界领先的 DeepAR 概率预测模型，但需从零编写复杂的 PyTorch 训练循环和数据处理逻辑，开发周期长达数周。\n- **缺乏不确定性量化**：传统回归模型只能输出单一预测值，无法提供置信区间，导致运维人员难以评估极端流量风险，往往被迫过度配置资源。\n- **数据预处理繁琐**：不同时间频率（如 5 分钟粒度）的数据清洗、对齐和背测（back-testing）需要手动编写大量样板代码，极易出错且难以维护。\n\n### 使用 pytorch-ts 后\n- **快速落地 SOTA 模型**：直接调用封装好的 `DeepAREstimator`，仅需几行代码即可加载 GluonTS 后端能力，将模型从调研到上线的时间缩短至几天。\n- **输出概率分布预测**：模型天然支持输出预测分布，团队能获取具体的上下界区间，从而在保障服务稳定性的前提下，将服务器冗余成本降低 20%。\n- **标准化数据流处理**：利用内置的 `ListDataset` 和转换工具，轻松处理多频率时间序列，自动完成训练集划分与回测，大幅减少了数据工程层面的重复劳动。\n\npytorch-ts 通过融合 PyTorch 的灵活性与 GluonTS 的成熟组件，让开发者能以极简代码实现高精度的概率时间序列预测，显著提升了决策的可靠性与研发效率。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fzalandoresearch_pytorch-ts_0b68d803.png","zalandoresearch","Zalando Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fzalandoresearch_fb8bb1b6.png","Repositories of the research branch of Zalando SE",null,"research@zalando.de","https:\u002F\u002Fresearch.zalando.com\u002F","https:\u002F\u002Fgithub.com\u002Fzalandoresearch",[84],{"name":85,"color":86,"percentage":87},"Python","#3572A5",100,1367,201,"2026-03-24T02:25:38","MIT","未说明","非必需。代码示例显示支持自动检测 CUDA (torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\"))，可在 CPU 上运行。具体显卡型号、显存大小及 CUDA 版本未在文档中明确指定。",{"notes":95,"python":96,"dependencies":97},"该工具是一个基于 PyTorch 的概率时间序列预测框架，后端依赖 GluonTS 进行数据加载和转换。安装仅需执行 'pip3 install pytorchts'。训练时可通过 'num_workers' 参数设置多进程加载数据。文档未提及具体的操作系统限制、最低内存要求或特定的 Python 小版本号。","未说明 (通过 pip3 安装暗示需要 Python 3)",[98,99,100,101,102],"pytorchts","torch","gluonts","pandas","matplotlib",[13],[105,106,107,108,109,110],"pytorch","time-series","probabilistic","deepar","lstnet","n-beats","2026-03-27T02:49:30.150509","2026-04-06T14:05:47.883711",[114,119,124,129,134,139],{"id":115,"question_zh":116,"answer_zh":117,"source_url":118},19014,"如何在 TransformerTempFlowEstimator 或 DeepVAR 模型中引入协变量（如分类特征或动态实数特征）？","模型本身会在 `create_transformation` 函数中自动创建一些协变量（如傅里叶时间特征、年龄特征、滞后特征等）。如果您想添加额外的协变量（如假期信息或其他动态实数特征），需要将它们作为 `FEAT_DYNAMIC_REAL`（动态实数）、`FEAT_STATIC_REAL`（静态实数）或 `FEAT_STATIC_CAT`（静态分类）字段添加到您的数据集中。维护者建议优先尝试使用 `DeepVAREstimator`，因为它对分类和动态实数协变量的支持更为完善。数据集构建示例：\n```python\ntrain_ds = ListDataset([{\n    FieldName.TARGET: target,\n    FieldName.START: start,\n    FieldName.FEAT_DYNAMIC_REAL: feat_dynamic_real,\n    FieldName.FEAT_STATIC_REAL: feat_static_real\n} for ...])\n```","https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts\u002Fissues\u002F3",{"id":120,"question_zh":121,"answer_zh":122,"source_url":123},19015,"训练 TFT (Temporal Fusion Transformer) 模型时遇到矩阵乘法形状不匹配错误 (RuntimeError: mat1 and mat2 shapes cannot be multiplied) 如何解决？","该错误通常是由于版本兼容性问题导致的。维护者建议将 `pytorch-ts` 库升级到最新版本（例如 0.5.1 或更高）来修复此问题。请运行以下命令进行更新：\n```bash\npip install --upgrade pytorch-ts\n```\n如果升级后仍有问题，请检查输入数据的维度配置是否与模型参数（如 `num_outputs`, `context_length`）匹配。","https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts\u002Fissues\u002F49",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},19016,"如何将 Pandas DataFrame 格式的数据转换为 PyTorch-TS\u002FGluonTS 所需的 ListDataset 格式？","您需要将数据转换为一个字典列表，每个字典包含 `\"target\"`（时间序列数值列表或数组）和 `\"start\"`（起始时间点）字段。如果是多序列数据，需遍历 Pandas DataFrame 的每一行或每个分组。\n转换示例代码：\n```python\nfrom gluonts.dataset.common import ListDataset\n\n# 假设 custom_dataset 是 numpy 数组，每行是一个时间序列\ntrain_ds = ListDataset(\n    [{'target': x, 'start': start_date} for x in custom_dataset[:, :-prediction_length]],\n    freq=\"1D\"\n)\n\ntest_ds = ListDataset(\n    [{'target': x, 'start': start_date} for x in custom_dataset],\n    freq=\"1D\"\n)\n```\n其中 `start_date` 是时间序列的起始时间（如 `pd.Timestamp` 对象），`freq` 是频率字符串（如 \"1D\", \"H\" 等）。","https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts\u002Fissues\u002F27",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},19017,"使用 DeepAR、TimeGrad 或 Transformer 模型进行多变量预测时，为什么预测结果全是负数或零，而训练数据均为非负数？","这通常是因为模型配置或数据缩放问题。对于多变量预测，维护者推荐使用 `DeepVAREstimator` 并正确配置输出分布和目标维度。确保设置 `scaling=True` 以启用数据缩放，并根据实际变量数量设置 `target_dim` 和 `distr_output`。\n修正后的配置示例：\n```python\nfrom pts.model.deepvar import DeepVAREstimator\nfrom pts.distributions import IndependentNormalOutput\n\nestimator = DeepVAREstimator(\n    input_size=23,\n    num_cells=16,\n    prediction_length=32,\n    context_length=32,\n    distr_output=IndependentNormalOutput(dim=8), # dim 应等于 target_dim\n    target_dim=8,                                # 目标变量数量\n    freq='W',\n    scaling=True,                                # 关键：启用缩放\n    trainer=Trainer(device=\"cuda\", epochs=150, learning_rate=1e-3)\n)\n```\n增加训练轮数（epochs）并确保学习率适当也有助于改善收敛。","https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts\u002Fissues\u002F82",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},19018,"如何使用 M5 竞赛数据集？出现 'M5 data is available on Kaggle' 错误怎么办？","M5 数据集受限于许可证，不会自动下载。您需要手动从 Kaggle 下载数据文件并将其放置在指定目录中。\n步骤如下：\n1. 登录 Kaggle 并下载 M5 竞赛数据（通常需要接受规则）。\n2. 将下载的文件解压到 GluonTS\u002FPyTorch-TS 的数据缓存目录，通常位于 `~\u002F.mxnet\u002Fgluon-ts\u002Fdatasets\u002Fm5\u002F` 或当前工作目录下的相应文件夹。\n3. 确保文件结构符合预期（包含 `sales_train_evaluation.csv` 等文件）。\n4. 再次运行 `get_dataset(\"m5\", regenerate=False)`。\n如果路径不同，可能需要设置环境变量或修改代码中的数据加载路径。","https:\u002F\u002Fgithub.com\u002Fzalandoresearch\u002Fpytorch-ts\u002Fissues\u002F28",{"id":140,"question_zh":141,"answer_zh":142,"source_url":118},19019,"节假日等外部特征应该如何处理？应该作为动态分类特征还是动态实数特征传入模型？","根据维护者的回复，节假日信息通常会被转换为**动态实数特征** (`FEAT_DYNAMIC_REAL`)。模型内部会对特定日期进行平滑处理（取决于使用的核函数），以便模型能够感知特定日期的临近和过去。目前库中对动态分类特征 (`FEAT_DYNAMIC_CAT`) 的支持较少，因为维护者尚未发现强烈的使用需求，因此建议优先将此类时间相关的外部特征编码为实数形式（如 0\u002F1 指示变量或平滑后的信号）传入。",[144,149,154,159,164,169,174,178,182],{"id":145,"version":146,"summary_zh":147,"released_at":148},117073,"v0.6.0","创建一个新版本用于修复小问题，并升级到 gluonts 0.9.x 版本的 API。","2022-04-24T16:24:31",{"id":150,"version":151,"summary_zh":152,"released_at":153},117074,"v0.5.1","修复了TFT变换问题。","2021-07-07T09:24:29",{"id":155,"version":156,"summary_zh":157,"released_at":158},117075,"v0.5.0","使用 GluonTS 0.8.0","2021-07-06T11:20:09",{"id":160,"version":161,"summary_zh":162,"released_at":163},117076,"v0.4.0","添加了TFT模型  \n添加了对glutonts 0.7.0的依赖","2021-04-27T16:03:18",{"id":165,"version":166,"summary_zh":167,"released_at":168},117077,"v0.3.1","修复了 `install_requires`","2021-02-15T12:29:34",{"id":170,"version":171,"summary_zh":172,"released_at":173},117078,"v0.3.0","该版本以 gluonts 作为依赖，并新增了一个模型。","2021-02-15T11:24:07",{"id":175,"version":176,"summary_zh":79,"released_at":177},117079,"v0.2.0","2020-09-01T13:01:54",{"id":179,"version":180,"summary_zh":79,"released_at":181},117080,"v0.1.1","2020-07-06T13:16:06",{"id":183,"version":184,"summary_zh":79,"released_at":185},117081,"v0.1.0","2020-07-06T11:30:10"]