[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-google--tf-quant-finance":3,"tool-google--tf-quant-finance":62},[4,18,28,36,45,54],{"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":24,"last_commit_at":25,"category_tags":26,"status":17},9989,"n8n","n8n-io\u002Fn8n","n8n 是一款面向技术团队的公平代码（fair-code）工作流自动化平台，旨在让用户在享受低代码快速构建便利的同时，保留编写自定义代码的灵活性。它主要解决了传统自动化工具要么过于封闭难以扩展、要么完全依赖手写代码效率低下的痛点，帮助用户轻松连接 400 多种应用与服务，实现复杂业务流程的自动化。\n\nn8n 特别适合开发者、工程师以及具备一定技术背景的业务人员使用。其核心亮点在于“按需编码”：既可以通过直观的可视化界面拖拽节点搭建流程，也能随时插入 JavaScript 或 Python 代码、调用 npm 包来处理复杂逻辑。此外，n8n 原生集成了基于 LangChain 的 AI 能力，支持用户利用自有数据和模型构建智能体工作流。在部署方面，n8n 提供极高的自由度，支持完全自托管以保障数据隐私和控制权，也提供云端服务选项。凭借活跃的社区生态和数百个现成模板，n8n 让构建强大且可控的自动化系统变得简单高效。",184740,2,"2026-04-19T23:22:26",[16,14,13,15,27],"插件",{"id":29,"name":30,"github_repo":31,"description_zh":32,"stars":33,"difficulty_score":10,"last_commit_at":34,"category_tags":35,"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":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":24,"last_commit_at":42,"category_tags":43,"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 真正成长为懂上",161147,"2026-04-19T23:31:47",[14,13,44],"语言模型",{"id":46,"name":47,"github_repo":48,"description_zh":49,"stars":50,"difficulty_score":51,"last_commit_at":52,"category_tags":53,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,27],{"id":55,"name":56,"github_repo":57,"description_zh":58,"stars":59,"difficulty_score":24,"last_commit_at":60,"category_tags":61,"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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"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":78,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":103,"forks":104,"last_commit_at":105,"license":106,"difficulty_score":24,"env_os":107,"env_gpu":108,"env_ram":107,"env_deps":109,"category_tags":119,"github_topics":120,"view_count":24,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":133,"updated_at":134,"faqs":135,"releases":165},9881,"google\u002Ftf-quant-finance","tf-quant-finance","High-performance TensorFlow library for quantitative finance.","tf-quant-finance 是一个基于 TensorFlow 构建的高性能量化金融开源库，旨在利用硬件加速和自动微分技术，为金融建模提供强大的计算支持。它主要解决了传统量化分析中复杂数学运算效率低、难以大规模并行处理以及模型校准困难等痛点。\n\n该库采用分层架构设计：底层提供优化、插值、线性代数及随机数生成等核心数学方法；中层涵盖微分方程求解器、伊藤过程框架及扩散路径生成器；上层则实现了局部波动率、随机波动率、Hull-White 等多种具体定价模型及其校准工具，并支持利率曲线构建。其独特亮点在于将深度学习框架的特性引入传统金融工程，使得从基础算法到复杂衍生品定价的各个环节都能高效运行，且各层级组件均可独立使用并配有丰富示例。\n\n需要注意的是，该项目目前已被归档并不再维护，适合需要参考其架构或希望自行 fork 继续开发的量化研究人员、金融工程师及熟悉 TensorFlow 的开发者使用。对于希望学习如何结合深度学习技术进行金融建模的用户，其中的教程和代码实现仍具有重要的参考价值。","# TF Quant Finance: TensorFlow based Quant Finance Library (ARCHIVED)\n\n> [!IMPORTANT]\n> This library is no longer maintained and has been archived. If you depend on\n> the functionality provided by this library, we suggest to fork it and continue\n> development elsewhere.\n\n[![Build Status](https:\u002F\u002Fstorage.googleapis.com\u002Ftf-quant-finance-build-result\u002Fstatus.svg?)](https:\u002F\u002Fstorage.googleapis.com\u002Ftf-quant-finance-build-result\u002Flogs.txt)\n\n## Table of contents\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n3. [TensorFlow training](#tensorflow-training)\n4. [Development roadmap](#development-roadmap)\n5. [Examples](#examples)\n6. [Contributing](#contributing)\n7. [Development](#development)\n8. [Community](#community)\n9. [Disclaimers](#disclaimers)\n10. [License](#license)\n\n## Introduction\n\nThis library provides high-performance components leveraging the hardware\nacceleration support and automatic differentiation of TensorFlow. The\nlibrary will provide TensorFlow support for foundational mathematical methods,\nmid-level methods, and specific pricing models. The coverage is being\nexpanded over the next few months.\n\nThe library is structured along three tiers:\n\n1. **Foundational methods**.\nCore mathematical methods - optimisation, interpolation, root finders,\nlinear algebra, random and quasi-random number generation, etc.\n\n2. **Mid-level methods**.\nODE & PDE solvers, Ito process framework, Diffusion Path Generators,\nCopula samplers etc.\n\n3. **Pricing methods and other quant finance specific utilities**.\nSpecific Pricing models (e.g., Local Vol (LV), Stochastic Vol (SV),\nStochastic Local Vol (SLV), Hull-White (HW)) and their calibration.\nRate curve building, payoff descriptions, and schedule generation.\n\nWe aim for the library components to be easily accessible at each level. Each layer will be accompanied by many examples that can run independently of\nhigher-level components.\n\n## Installation\n\nThe easiest way to get started with the library is via the pip package.\n\nNote that the library requires Python 3.7 and Tensorflow >= 2.7.\n\nFirst, please install the most recent version of TensorFlow by following\nthe [TensorFlow installation instructions](https:\u002F\u002Ftensorflow.org\u002Finstall).\nFor example, you could install TensorFlow\n\n```sh\npip3 install --upgrade tensorflow\n```\n\nThen run\n\n```sh\npip3 install --upgrade tf-quant-finance\n```\n\nYou maybe also have to use the option ```--user```.\n\n## TensorFlow training\n\nIf you are not familiar with TensorFlow, an excellent place to get started is with the\nfollowing self-study introduction to TensorFlow notebooks:\n\n   * [Introduction to TensorFlow Part 1 - Basics](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_1_-_Basics.ipynb).\n   * [Introduction to TensorFlow Part 2 - Debugging and Control Flow](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_2_-_Debugging_and_Control_Flow.ipynb).\n   * [Introduction to TensorFlow Part 3 - Advanced Tensor Manipulation](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_3_-_Advanced_Tensor_Manipulation.ipynb).\n\n## Development roadmap\n\nWe are working on expanding the coverage of the library. Areas under active development are:\n\n  * Ito Processes: Framework for defining [Ito processes](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FIt%C3%B4_calculus#It%C3%B4_processes).\n  Includes methods for sampling paths from a process and for solving the\n  associated backward Kolmogorov equation.\n  * Implementation of the following specific processes\u002Fmodels:\n      * Brownian Motion\n      * Geometric Brownian Motion\n      * Ornstein-Uhlenbeck\n      * One-Factor Hull-White model\n      * Heston model\n      * Local volatility model.\n      * Quadratic Local Vol model.\n      * SABR model\n  * Copulas: Support for defining and sampling from copulas.\n  * Model Calibration:\n      * Dupire local vol calibration.\n      * SABR model calibration.\n  * Rate curve fitting: Hagan-West algorithm for yield curve bootstrapping and the Monotone Convex interpolation scheme.\n  * Support for dates, day-count conventions, holidays, etc.\n\n\n## Examples\n\nSee [`tf_quant_finance\u002Fexamples\u002F`](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Ftree\u002Fmaster\u002Ftf_quant_finance\u002Fexamples)\nfor end-to-end examples. It includes tutorial notebooks such as:\n\n  *   [American Option pricing under the Black-Scholes model](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FAmerican_Option_Black_Scholes.ipynb)\n  *   [Monte Carlo via Euler Scheme](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FMonte_Carlo_Euler_Scheme.ipynb)\n  *   [Black Scholes: Price and Implied Vol](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FBlack_Scholes_Price_and_Implied_Vol.ipynb)\n  *   [Forward and Backward mode gradients in TFF](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FForward_Backward_Diff.ipynb)\n  *   [Root search using Brent's method](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FRoot_Search.ipynb)\n  *   [Optimization](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FOptimization.ipynb)\n  *   [Swap Curve Fitting](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FSwap_Curve_Fitting.ipynb)\n  *   [Vectorization and XLA compilation](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FVectorization_and_XLA_compilation.ipynb)\n\nThe above links will open Jupyter Notebooks in Colab.\n\n## Contributing\n\nWe're eager to collaborate with you! See [CONTRIBUTING.md](CONTRIBUTING.md) for a guide on how to contribute. This project adheres to TensorFlow's code of conduct. By participating, you are expected to uphold this code.\n\n## Development\n\nThis section is for developers who want to contribute code to the\nlibrary. If you are only interested in using the library, please follow the\ninstructions in the [Installation](#installation) section.\n\n### Development dependencies\n\nThis library has the following dependencies:\n\n1.  Bazel\n2.  Python 3 (Bazel uses Python 3 by default)\n3.  TensorFlow version >= 2.7\n4.  TensorFlow Probability version between v0.11.0 and v0.12.1\n5.  Numpy version 1.21 or higher\n6.  Attrs\n7.  Dataclasses (not needed if your Python version >= 3.7)\n\nThis library requires the\n[Bazel](https:\u002F\u002Fbazel.build\u002F) build system. Please follow the\n[Bazel installation instructions](https:\u002F\u002Fdocs.bazel.build\u002Fversions\u002Fmaster\u002Finstall.html)\nfor your platform.\n\n\nYou can install TensorFlow and related dependencies using the ```pip3 install```\ncommand:\n\n```sh\npip3 install --upgrade tf-nightly tensorflow-probability==0.12.1 numpy==1.21 attrs dataclasses\n```\n\n### Commonly used commands\n\nClone the GitHub repository:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance.git\n```\n\nAfter you run\n\n```sh\ncd tf_quant_finance\n```\n\nyou can execute tests using the ```bazel test``` command. For example,\n\n```sh\nbazel test tf_quant_finance\u002Fmath\u002Frandom_ops\u002Fsobol:sobol_test\n```\n\nwill run tests in\n[sobol_test.py](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fmath\u002Frandom_ops\u002Fsobol\u002Fsobol_test.py)\n.\n\nTests run using Python version 3. Please make sure that you can\nrun ```import tensorflow``` in the Python 3 shell. Otherwise, tests might fail.\n\n### Building a custom pip package\n\nThe following commands will build custom pip package from source and install it:\n\n```sh\n# sudo apt-get install bazel git python python-pip rsync # For Ubuntu.\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance.git\ncd tf-quant-finance\nbazel build :build_pip_pkg\n.\u002Fbazel-bin\u002Fbuild_pip_pkg artifacts\npip install --user --upgrade artifacts\u002F*.whl\n```\n\n## Community\n\n1. [GitHub repository](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance): Report bugs or make feature requests.\n\n2. [TensorFlow Blog](https:\u002F\u002Fblog.tensorflow.org\u002F): Stay up to date on content from the TensorFlow team and best articles from the community.\n\n3. tf-quant-finance@googlegroups.com: Open mailing list for discussion and questions of this library.\n\n4. TensorFlow Probability: This library will leverage methods from [TensorFlow Probability](https:\u002F\u002Fwww.tensorflow.org\u002Fprobability) (TFP).\n\n## Disclaimers\n\nGoogle does not officially support this product. This library is under active development, and interfaces may change at any time.\n\n## License\n\nThis library is licensed under the Apache 2 license (see [LICENSE](LICENSE)). This library uses Sobol primitive polynomials and initial direction numbers\nwhich are licensed under the BSD license.\n","# TF量化金融：基于TensorFlow的量化金融库（已归档）\n\n> [!重要]\n> 本库已停止维护并被归档。如果您依赖于该库提供的功能，我们建议您将其fork到其他地方继续开发。\n\n[![构建状态](https:\u002F\u002Fstorage.googleapis.com\u002Ftf-quant-finance-build-result\u002Fstatus.svg?)](https:\u002F\u002Fstorage.googleapis.com\u002Ftf-quant-finance-build-result\u002Flogs.txt)\n\n## 目录\n1. [简介](#introduction)\n2. [安装](#installation)\n3. [TensorFlow训练](#tensorflow-training)\n4. [开发路线图](#development-roadmap)\n5. [示例](#examples)\n6. [贡献](#contributing)\n7. [开发](#development)\n8. [社区](#community)\n9. [免责声明](#disclaimers)\n10. [许可证](#license)\n\n## 简介\n\n本库利用TensorFlow的硬件加速支持和自动微分功能，提供了高性能的组件。该库将为基础数学方法、中层方法以及特定定价模型提供TensorFlow支持。未来几个月内，我们将逐步扩大其覆盖范围。\n\n库的结构分为三个层次：\n\n1. **基础方法**。\n   核心数学方法——优化、插值、求根算法、线性代数、随机及拟随机数生成等。\n\n2. **中层方法**。\n   ODE与PDE求解器、伊藤过程框架、扩散路径生成器、Copula采样器等。\n\n3. **定价方法及其他量化金融专用工具**。\n   特定定价模型（如局部波动率LV、随机波动率SV、随机局部波动率SLV、Hull-White HW模型）及其校准。利率曲线构建、收益描述和日程安排生成。\n\n我们的目标是使库中的每个层次组件都易于访问。每一层都将附带大量示例，这些示例可以独立于更高级别的组件运行。\n\n## 安装\n\n开始使用本库最简单的方式是通过pip包管理器。\n\n请注意，本库需要Python 3.7和TensorFlow >= 2.7。\n\n首先，请按照[TensorFlow安装指南](https:\u002F\u002Ftensorflow.org\u002Finstall)安装最新版本的TensorFlow。例如，您可以运行以下命令来安装TensorFlow：\n\n```sh\npip3 install --upgrade tensorflow\n```\n\n然后运行：\n\n```sh\npip3 install --upgrade tf-quant-finance\n```\n\n您可能还需要使用`--user`选项。\n\n## TensorFlow训练\n\n如果您不熟悉TensorFlow，可以从以下自学习的TensorFlow入门笔记本开始：\n\n   * [TensorFlow入门第一部分——基础](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_1_-_Basics.ipynb)。\n   * [TensorFlow入门第二部分——调试与控制流](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_2_-_Debugging_and_Control_Flow.ipynb)。\n   * [TensorFlow入门第三部分——高级张量操作](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FIntroduction_to_TensorFlow_Part_3_-_Advanced_Tensor_Manipulation.ipynb)。\n\n## 开发路线图\n\n我们正在努力扩展库的功能覆盖范围。目前处于积极开发中的领域包括：\n\n  * 伊藤过程：用于定义[伊藤过程](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FIt%C3%B4_calculus#It%C3%B4_processes)的框架。\n    包括从过程中采样路径以及求解相关后向柯尔莫哥洛夫方程的方法。\n  * 实现以下特定过程\u002F模型：\n      * 布朗运动\n      * 几何布朗运动\n      * 奥恩斯坦-乌伦贝克过程\n      * 单因子Hull-White模型\n      * Heston模型\n      * 局部波动率模型\n      * 二次局部波动率模型\n      * SABR模型\n  * Copulas：支持定义和采样Copula分布。\n  * 模型校准：\n      * Dupire局部波动率校准\n      * SABR模型校准\n  * 利率曲线拟合：Hagan-West算法用于收益率曲线构建，以及单调凸插值方案。\n  * 对日期、天数计算规则、节假日等的支持。\n\n## 示例\n\n请参阅[`tf_quant_finance\u002Fexamples\u002F`](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Ftree\u002Fmaster\u002Ftf_quant_finance\u002Fexamples)，其中包含端到端示例。其中包括教程笔记本，例如：\n\n  *   [Black-Scholes模型下的美式期权定价](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FAmerican_Option_Black_Scholes.ipynb)\n  *   [基于欧拉格式的蒙特卡洛模拟](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FMonte_Carlo_Euler_Scheme.ipynb)\n  *   [Black-Scholes：价格与隐含波动率](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FBlack_Scholes_Price_and_Implied_Vol.ipynb)\n  *   [TFF中的前向和后向模式梯度](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FForward_Backward_Diff.ipynb)\n  *   [使用Brent方法求根](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FRoot_Search.ipynb)\n  *   [优化](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FOptimization.ipynb)\n  *   [互换曲线拟合](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FSwap_Curve_Fitting.ipynb)\n  *   [向量化与XLA编译](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002FVectorization_and_XLA_compilation.ipynb)\n\n以上链接将在Colab中打开Jupyter笔记本。\n\n## 贡献\n\n我们非常期待与您的合作！请参阅[CONTRIBUTING.md](CONTRIBUTING.md)，了解如何贡献代码。本项目遵循TensorFlow的行为准则。参与时，您应遵守该准则。\n\n## 开发\n\n本节面向希望为库贡献代码的开发者。如果您只是想使用该库，请按照[安装](#installation)部分的说明进行操作。\n\n### 开发依赖项\n\n该库具有以下依赖项：\n\n1. Bazel\n2. Python 3（Bazel 默认使用 Python 3）\n3. TensorFlow 版本 ≥ 2.7\n4. TensorFlow Probability 版本介于 v0.11.0 和 v0.12.1 之间\n5. Numpy 版本 1.21 或更高\n6. Attrs\n7. Dataclasses（如果您的 Python 版本 ≥ 3.7，则不需要）\n\n该库需要使用\n[Bazel](https:\u002F\u002Fbazel.build\u002F) 构建系统。请按照适用于您平台的\n[Bazel 安装说明](https:\u002F\u002Fdocs.bazel.build\u002Fversions\u002Fmaster\u002Finstall.html)\n进行安装。\n\n\n您可以使用 ```pip3 install``` 命令安装 TensorFlow 及相关依赖项：\n\n```sh\npip3 install --upgrade tf-nightly tensorflow-probability==0.12.1 numpy==1.21 attrs dataclasses\n```\n\n### 常用命令\n\n克隆 GitHub 仓库：\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance.git\n```\n\n运行\n\n```sh\ncd tf_quant_finance\n```\n\n之后，您可以使用 ```bazel test``` 命令执行测试。例如，\n\n```sh\nbazel test tf_quant_finance\u002Fmath\u002Frandom_ops\u002Fsobol:sobol_test\n```\n\n将运行位于\n[sobol_test.py](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fblob\u002Fmaster\u002Ftf_quant_finance\u002Fmath\u002Frandom_ops\u002Fsobol\u002Fsobol_test.py)\n中的测试。\n\n测试使用 Python 3 版本运行。请确保您可以在 Python 3 的交互式 shell 中成功执行 ```import tensorflow```。否则，测试可能会失败。\n\n### 构建自定义 pip 包\n\n以下命令将从源代码构建自定义 pip 包并将其安装：\n\n```sh\n# sudo apt-get install bazel git python python-pip rsync # 适用于 Ubuntu。\ngit clone https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance.git\ncd tf-quant-finance\nbazel build :build_pip_pkg\n.\u002Fbazel-bin\u002Fbuild_pip_pkg artifacts\npip install --user --upgrade artifacts\u002F*.whl\n```\n\n## 社区\n\n1. [GitHub 仓库](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance)：报告错误或提出功能请求。\n2. [TensorFlow 博客](https:\u002F\u002Fblog.tensorflow.org)：及时了解 TensorFlow 团队的内容以及社区中的优秀文章。\n3. tf-quant-finance@googlegroups.com：用于讨论和提问的开放邮件列表。\n4. TensorFlow Probability：该库将利用来自 [TensorFlow Probability](https:\u002F\u002Fwww.tensorflow.org\u002Fprobability) (TFP) 的方法。\n\n## 免责声明\n\nGoogle 不正式支持本产品。该库目前处于积极开发中，接口可能会随时发生变化。\n\n## 许可证\n\n本库采用 Apache 2 许可证授权（参见 [LICENSE](LICENSE)）。本库使用 Sobol 原始多项式和初始方向数，这些内容采用 BSD 许可证授权。","# tf-quant-finance 快速上手指南\n\n> **⚠️ 重要提示**：该库已停止维护并归档（ARCHIVED）。如果您依赖此库的功能，建议 Fork 该项目并在其他地方继续开发。以下内容仅作为历史版本的使用参考。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (需配置相应 Python 环境)\n*   **Python 版本**：>= 3.7\n*   **核心依赖**：\n    *   TensorFlow >= 2.7\n    *   (可选开发依赖) Bazel, NumPy >= 1.21, TensorFlow Probability (v0.11.0 - v0.12.1)\n\n> **国内加速建议**：由于该库托管于 Google 相关生态，国内用户在安装 TensorFlow 或访问 Colab 示例时可能会遇到网络问题。建议使用国内镜像源安装基础依赖，或通过代理工具加速连接。\n\n## 安装步骤\n\n最便捷的方式是通过 `pip` 进行安装。\n\n### 1. 安装\u002F升级 TensorFlow\n首先安装或升级 TensorFlow 至最新版本（推荐使用国内镜像源加速）：\n\n```sh\npip3 install --upgrade tensorflow -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 2. 安装 tf-quant-finance\n接着安装量化金融库：\n\n```sh\npip3 install --upgrade tf-quant-finance -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n*注：如果遇到权限问题，请在命令末尾添加 `--user` 参数。*\n\n## 基本使用\n\n该库提供了从基础数学方法到具体定价模型的三层架构。以下是一个最简单的使用示例，演示如何利用该库计算 **Black-Scholes 模型下的期权价格**。\n\n您可以直接在 Python 脚本或 Jupyter Notebook 中运行以下代码：\n\n```python\nimport tensorflow as tf\nimport tf_quant_finance as tff\n\n# 定义市场参数\nspots = tf.constant([100.0])       # 标的资产现价\nstrikes = tf.constant([100.0])     # 行权价\nexpiries = tf.constant([1.0])      # 到期时间 (年)\nvolatilities = tf.constant([0.2])  # 波动率\nrates = tf.constant([0.05])        # 无风险利率\ndividends = tf.constant([0.0])     # 股息率\n\n# 调用 Black-Scholes 定价引擎\nprices = tff.black_scholes.option_price(\n    volatilities=volatilities,\n    spots=spots,\n    strikes=strikes,\n    expiries=expiries,\n    rates=rates,\n    dividends=dividends\n)\n\n# 输出结果\nprint(\"Option Price:\", prices.numpy())\n```\n\n### 更多学习资源\n由于库已归档，官方 Colab 链接可能加载缓慢或失效。建议查看本地安装后的示例目录获取完整教程：\n*   路径：`tf_quant_finance\u002Fexamples\u002Fjupyter_notebooks\u002F`\n*   包含内容：美式期权定价、蒙特卡洛模拟、利率曲线构建等端到端示例。","某量化对冲基金的开发团队正在构建基于深度学习的期权定价系统，需要高效处理随机波动率模型（如 Heston 模型）的大规模蒙特卡洛模拟与参数校准。\n\n### 没有 tf-quant-finance 时\n- **底层算法重复造轮子**：团队需手动编写复杂的金融数学原语（如随机数生成、插值法、求根算法），不仅耗时且容易引入数值计算错误。\n- **缺乏硬件加速支持**：传统 Python 库（如 NumPy）难以利用 GPU 并行计算能力，导致百万级路径模拟耗时数小时，无法满足实时交易需求。\n- **自动微分实现困难**：在校准模型参数时，手动推导并编码梯度公式极其繁琐，限制了使用高级优化器进行端到端训练的可能性。\n- **模型扩展性差**：每新增一种随机过程（如从几何布朗运动扩展到局部波动率模型），都需要重构大量底层代码，维护成本高昂。\n\n### 使用 tf-quant-finance 后\n- **开箱即用的高性能组件**：直接调用库中封装好的基础数学方法和伊藤过程框架，大幅减少底层代码开发量，确保数值稳定性。\n- **原生 GPU 加速推理**：依托 TensorFlow 后端，轻松将蒙特卡洛模拟任务迁移至 GPU，将原本数小时的计算压缩至分钟级甚至秒级。\n- **无缝集成自动微分**：利用 TensorFlow 的自动微分特性，无需手动推导梯度即可快速完成复杂模型（如 SABR 或 Hull-White）的参数校准。\n- **模块化架构便于扩展**：通过分层设计（基础层、中间层、定价层），团队可灵活组合不同模块快速搭建新的定价模型，显著缩短研发周期。\n\ntf-quant-finance 通过将高性能计算与金融领域知识深度融合，让量化团队能专注于策略创新而非底层算法实现。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgoogle_tf-quant-finance_e3c2649c.png","google","Google","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgoogle_c4bedcda.png","Google ❤️ Open Source",null,"opensource@google.com","GoogleOSS","https:\u002F\u002Fopensource.google\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle",[83,87,91,95,99],{"name":84,"color":85,"percentage":86},"Python","#3572A5",68,{"name":88,"color":89,"percentage":90},"Jupyter Notebook","#DA5B0B",29.7,{"name":92,"color":93,"percentage":94},"Starlark","#76d275",2.1,{"name":96,"color":97,"percentage":98},"Dockerfile","#384d54",0.1,{"name":100,"color":101,"percentage":102},"Shell","#89e051",0,5312,678,"2026-04-19T18:43:55","Apache-2.0","未说明","未明确必需，但库利用 TensorFlow 的硬件加速支持（通常指 GPU），具体型号、显存及 CUDA 版本未在文中指定",{"notes":110,"python":111,"dependencies":112},"该项目已归档（ARCHIVED），不再维护。建议用户 Fork 后自行继续开发。开发环境需要安装 Bazel 构建系统。该库主要提供基于 TensorFlow 的量化金融组件，包括基础数学方法、中阶方法（如 ODE\u002FPDE 求解器）及定价模型。","3.7+",[113,114,115,116,117,118],"tensorflow>=2.7","tensorflow-probability>=0.11.0, \u003C=0.12.1","numpy>=1.21","attrs","dataclasses (Python \u003C 3.7 时需要)","bazel (开发构建必需)",[14,27],[121,122,123,124,125,126,127,128,129,130,131,132],"tensorflow","quantitative-finance","python","finance","numerical-methods","numerical-optimization","numerical-integration","high-performance","high-performance-computing","gpu","gpu-computing","quantlib","2026-03-27T02:49:30.150509","2026-04-20T10:23:17.502346",[136,141,146,151,155,160],{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},44394,"是否支持使用 Cox-Ross-Rubinstein (CRR) 二叉树模型对美式期权进行定价？","是的，项目中已添加了 CRR 二叉树模型的版本，可用于美式和欧式期权定价。目前的实现可能还不是最通用的，主要的局限性在于暂时不支持随时间变化的利率和波动率（time dependent rates and volatility），但这些功能计划在后续迭代中进行修复和支持。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fissues\u002F10",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},44390,"在使用 XLA 编译包含路径依赖型收益（如 TARF）的蒙特卡洛模拟时遇到 'TensorListReserve' 错误，如何解决？","通常是因为在用于 XLA 编译的函数内部嵌套了 `@tf.function` 装饰器。解决方法是从内部的收益计算函数（例如 `tarf_payoff`）中移除 `@tf.function` 装饰器。一般来说，为了避免 XLA 编译问题，应避免嵌套使用 `tf.function`。此外，确保编译后的函数接收的是 Tensor 输入而不是 numpy 对象。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fissues\u002F73",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},44391,"如何在 TensorFlow Quant Finance 中实现 Bjerksund-Stensland 美式期权定价近似算法？","该模块应位于 `tf_quant_finance\u002Fvolatility\u002Famerican_option.py` 下，并支持看跌期权（puts）和看涨期权（calls）。为了提高性能，特别是 GPU 性能，建议使用批处理计算（batched calculation）或 `tf.vectorized_map` 来并行化循环。维护者提供的 Colab 示例显示，使用批处理版本可以将 100k 期权的定价时间从 70ms 缩短至 10ms。测试文件应放在同目录下的 `american_option_test.py`。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fissues\u002F5",{"id":152,"question_zh":153,"answer_zh":154,"source_url":150},44392,"在运行美式期权代码时遇到张量形状（shape）不匹配的错误，特别是在非 Colab 环境下，该如何修复？","错误通常发生在计算 `res` 的行，原因是循环次数基于了错误的张量秩（rank）。如果 `expiries` 的形状与其他主要输入（如 `volatilities` 或 `spots`）不一致，会导致问题。解决方案是将循环代码 `for _ in range(asr.shape.rank):` 修改为 `for _ in range(hk.shape.rank):`，因为 `hk` 的形状是基于定义其他张量形状的主张量（通常是 `volatilities`）确定的。",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},44393,"如何为 Black-Scholes 模型下的障碍期权（Barrier Options）添加定价公式支持？","实现该功能的模块应位于 `tf_quant_finance\u002Fvolatility\u002Fbarrier_option.py`。需要支持多种类型的障碍期权，包括看跌期权（向上触及生效 put、向下触及失效 put）和看涨期权（向下触及生效 call、向上触及失效 call）。相关的单元测试应放在同目录下的 `barrier_option_test.py` 中。如果有 XLA 测试用例，也欢迎贡献。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fissues\u002F7",{"id":161,"question_zh":162,"answer_zh":163,"source_url":164},44395,"在克隆仓库时收到关于大小写敏感路径冲突的警告（例如 Month.md 和 month.md），这意味着什么？","这通常发生在大小写不敏感的文件系统（如 Windows 或 macOS 默认配置）上克隆包含大小写不同但名称相同文件的项目时。警告表明只有其中一个文件会被保留在工作区中。虽然这是一个文件系统层面的限制，但项目方通常会标记此类问题为已解决或尝试重命名文件以避免冲突。用户若遇到此问题，需留意可能缺失了某个特定大小写命名的文档文件。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ftf-quant-finance\u002Fissues\u002F72",[166,171,176,181],{"id":167,"version":168,"summary_zh":169,"released_at":170},351942,"v0.0.1-dev9","发布说明：\n- 添加了 Colab 示例“TensorFlow 入门 第2部分：调试与控制流”\n- TF 量化金融现要求 TensorFlow 版本 ≥ 1.14，TensorFlow Probability 版本 ≥ 0.7.0。","2019-09-17T12:03:42",{"id":172,"version":173,"summary_zh":174,"released_at":175},351943,"v0.0.1-dev8","发布说明：\n- 新增了一个 Colab 示例，演示基于 Brent 方法的根查找；\n- 修复了微分算子的导入问题；\n","2019-09-13T13:00:01",{"id":177,"version":178,"summary_zh":179,"released_at":180},351944,"v0.0.1-dev7","主要功能与改进：\n- 新增优化算法：BFGS、L-BFGS、共轭梯度下降法、Nelder-Mead法；\n- 新增基于Hagan–West插值的债券收益率曲线拟合功能；\n- 为多元正态分布采样新增反向随机数生成方式；\n- 新增多个Jupyter Notebook示例；\n- 修复了若干Bug。","2019-09-12T15:15:31",{"id":182,"version":183,"summary_zh":184,"released_at":185},351945,"v0.0.1-dev6","TF Quant Finance 库的开发版本。","2019-09-06T13:09:06"]