GitRead 中文社区
首页趋势排行榜原创文章严选周刊
更多资源
新手训练营
精选专题热门话题GitHub 文档资源精选实战指南

tf-quant-finance

High-performance TensorFlow library for quantitative finance.

  • 语言Python
  • 默认分支master
  • 大小17.3 MB
  • 更新8月7日
  • Issues28
在 GitHub 打开
avatargoogle

项目介绍

google/tf-quant-finance 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Apache License 2.0 许可证,目前获得 5.6k 个 Star、688 次 Fork。

仓库全名
google/tf-quant-finance

README 摘要

TF Quant Finance: TensorFlow based Quant Finance Library (ARCHIVED) [!IMPORTANT] This library is no longer maintained and has been archived. If you depend on the functionality provided by this library, we suggest to fork it and continue development elsewhere. Table of contents 1. Introduction 2. Installation 3. TensorFlow training 4. Development roadmap 5. Examples 6. Contributing 7. Development 8. Community 9…

完整内容见 GitHub 原始 README 或本页 。

常见问题

tf-quant-finance 用什么语言开发?

主要使用 Python 编写,采用 Apache License 2.0 许可证,目前有 5.6k 个 Star。

tf-quant-finance 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 tf-quant-finance 的源码?

可以直接克隆仓库:git clone https://github.com/google/tf-quant-finance.git,默认分支为 master;安装与运行步骤见仓库 README。

tf-quant-finance 最近还在维护吗?

仓库最近一次更新为 8月7日,当前有 28 个未关闭 Issue;Star 数为 5.6k,可作为社区活跃度的参考。

本页面展示项目元数据与原始 README,GitRead 中文社区 编辑团队负责选题收录。

相关仓库

public-apis/public-apis avatar
public-apispublic-apis
2 天前
497.7k
55.6k
2.6k

免费 API 汇总列表

apipublic-apisfree+7
Python
15.5 MB
7
详情
EbookFoundation/free-programming-books avatar
free-programming-booksEbookFoundation
2 天前
401.4k
64.4k
39

免费可获取的编程书籍

bookseducationhacktoberfest+2
Python
21.8 MB
3
详情
donnemartin/system-design-primer avatar
system-design-primerdonnemartin
9月15日
377.5k
57.4k
291

学习如何设计大规模系统。为系统设计面试做准备。包含 Anki 闪卡。

designdesign-patternsdesign-system+10
Python
11.0 MB
0
详情
vinta/awesome-python avatar
awesome-pythonvinta
1 天前
333.6k
28.0k
0

回答“我想用 Python 做 X,该用哪个工具?”的权威清单

awesomeawesome-listpython+3
Python
6.9 MB
2
详情
practical-tutorials/project-based-learning avatar
project-based-learningpractical-tutorials
23 小时前
289.4k
36.8k
238

精选的项目实战教程列表

tutorialprojectbeginner-project+5
Python
472 KB
1
详情
NousResearch/hermes-agent avatar
hermes-agentNousResearch
2 小时前
262.1k
58.4k
54.0k

与你共同成长的智能体

aiai-agentai-agents+10
Python
1.4 GB
3
详情
TheAlgorithms/Python avatar
PythonTheAlgorithms
1 周前
226.0k
51.3k
90

所有算法均用 Python 实现

algorithmalgorithm-competitionsalgorithms-implemented+11
Python
17.9 MB
2
详情
yt-dlp/yt-dlp avatar
yt-dlpyt-dlp
5 天前
206.5k
18.2k
2.8k

功能丰富的命令行音视频下载器

youtube-dlpythonsponsorblock+4
Python
63.5 MB
0
详情

关于

financegpugpu-computinghigh-performancehigh-performance-computingnumerical-integrationnumerical-methodsnumerical-optimizationpythonquantitative-financequantlibtensorflow
  • Apache License 2.0
  • 5.6k Stars
  • 688 Forks
  • 173 Watching

简要分析

热度分
7113
价值分
3560
活跃状态
活跃
GitHub

语言占比

Dockerfile
Jupyter Notebook
Python
Shell
Starlark

Release

  • TF Quant Finance 0.0.1-dev92019年9月17日
  • TF Quant Finance 0.0.1-dev82019年9月13日
  • TF Quant Finance 0.0.1-dev72019年9月12日
  • TF Quant Finance 0.0.1-dev62019年9月6日

贡献者

cyrilchimisov-aicyrilchimisov-aimatejrmatejrtf-quant-finance-robottf-quant-finance-robotamitvarshney00amitvarshney00pshmakovpshmakovperezjuperezjuDevarakondaVDevarakondaVyileiyileiclee-ytclee-ytyl7890yl7890rajflumerajflumealexlembckealexlembcke

TF Quant Finance: TensorFlow based Quant Finance Library (ARCHIVED)

[!IMPORTANT] This library is no longer maintained and has been archived. If you depend on the functionality provided by this library, we suggest to fork it and continue development elsewhere.

Build Status

Table of contents

  1. Introduction
  2. Installation
  3. TensorFlow training
  4. Development roadmap
  5. Examples
  6. Contributing
  7. Development
  8. Community
  9. Disclaimers
  10. License

Introduction

This library provides high-performance components leveraging the hardware acceleration support and automatic differentiation of TensorFlow. The library will provide TensorFlow support for foundational mathematical methods, mid-level methods, and specific pricing models. The coverage is being expanded over the next few months.

The library is structured along three tiers:

  1. Foundational methods. Core mathematical methods - optimisation, interpolation, root finders, linear algebra, random and quasi-random number generation, etc.

  2. Mid-level methods. ODE & PDE solvers, Ito process framework, Diffusion Path Generators, Copula samplers etc.

  3. Pricing methods and other quant finance specific utilities. Specific Pricing models (e.g., Local Vol (LV), Stochastic Vol (SV), Stochastic Local Vol (SLV), Hull-White (HW)) and their calibration. Rate curve building, payoff descriptions, and schedule generation.

We 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 higher-level components.

Installation

The easiest way to get started with the library is via the pip package.

Note that the library requires Python 3.7 and Tensorflow >= 2.7.

First, please install the most recent version of TensorFlow by following the TensorFlow installation instructions. For example, you could install TensorFlow

pip3 install --upgrade tensorflow

Then run

pip3 install --upgrade tf-quant-finance

You maybe also have to use the option --user.

TensorFlow training

If you are not familiar with TensorFlow, an excellent place to get started is with the following self-study introduction to TensorFlow notebooks:

  • Introduction to TensorFlow Part 1 - Basics.
  • Introduction to TensorFlow Part 2 - Debugging and Control Flow.
  • Introduction to TensorFlow Part 3 - Advanced Tensor Manipulation.

Development roadmap

We are working on expanding the coverage of the library. Areas under active development are:

  • Ito Processes: Framework for defining Ito processes. Includes methods for sampling paths from a process and for solving the associated backward Kolmogorov equation.
  • Implementation of the following specific processes/models:
    • Brownian Motion
    • Geometric Brownian Motion
    • Ornstein-Uhlenbeck
    • One-Factor Hull-White model
    • Heston model
    • Local volatility model.
    • Quadratic Local Vol model.
    • SABR model
  • Copulas: Support for defining and sampling from copulas.
  • Model Calibration:
    • Dupire local vol calibration.
    • SABR model calibration.
  • Rate curve fitting: Hagan-West algorithm for yield curve bootstrapping and the Monotone Convex interpolation scheme.
  • Support for dates, day-count conventions, holidays, etc.

Examples

See tf_quant_finance/examples/ for end-to-end examples. It includes tutorial notebooks such as:

  • American Option pricing under the Black-Scholes model
  • Monte Carlo via Euler Scheme
  • Black Scholes: Price and Implied Vol
  • Forward and Backward mode gradients in TFF
  • Root search using Brent’s method
  • Optimization
  • Swap Curve Fitting
  • Vectorization and XLA compilation

The above links will open Jupyter Notebooks in Colab.

Contributing

We’re eager to collaborate with you! See 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.

Development

This section is for developers who want to contribute code to the library. If you are only interested in using the library, please follow the instructions in the Installation section.

Development dependencies

This library has the following dependencies:

  1. Bazel
  2. Python 3 (Bazel uses Python 3 by default)
  3. TensorFlow version >= 2.7
  4. TensorFlow Probability version between v0.11.0 and v0.12.1
  5. Numpy version 1.21 or higher
  6. Attrs
  7. Dataclasses (not needed if your Python version >= 3.7)

This library requires the Bazel build system. Please follow the Bazel installation instructions for your platform.

You can install TensorFlow and related dependencies using the pip3 install command:

pip3 install --upgrade tf-nightly tensorflow-probability==0.12.1 numpy==1.21 attrs dataclasses

Commonly used commands

Clone the GitHub repository:

git clone https://github.com/google/tf-quant-finance.git

After you run

cd tf_quant_finance

you can execute tests using the bazel test command. For example,

bazel test tf_quant_finance/math/random_ops/sobol:sobol_test

will run tests in sobol_test.py .

Tests run using Python version 3. Please make sure that you can run import tensorflow in the Python 3 shell. Otherwise, tests might fail.

Building a custom pip package

The following commands will build custom pip package from source and install it:

# sudo apt-get install bazel git python python-pip rsync # For Ubuntu.
git clone https://github.com/google/tf-quant-finance.git
cd tf-quant-finance
bazel build :build_pip_pkg
./bazel-bin/build_pip_pkg artifacts
pip install --user --upgrade artifacts/*.whl

Community

  1. GitHub repository: Report bugs or make feature requests.

  2. TensorFlow Blog: Stay up to date on content from the TensorFlow team and best articles from the community.

  3. [email protected]: Open mailing list for discussion and questions of this library.

  4. TensorFlow Probability: This library will leverage methods from TensorFlow Probability (TFP).

Disclaimers

Google does not officially support this product. This library is under active development, and interfaces may change at any time.

License

This library is licensed under the Apache 2 license (see LICENSE). This library uses Sobol primitive polynomials and initial direction numbers which are licensed under the BSD license.

评论

登录 后发表评论
暂无评论
GitRead 中文社区
深度解读 · 趋势洞察 · 价值精选

关于

关于我们联系我们编辑准则收录标准赞赏人员

发现

技术趋势新手训练营资源精选实战指南精选专题热门话题GitHub 文档

条款

隐私政策服务条款网站地图
26.9万收录项目
5.5万中文话题
155精选专题
发现技术价值,连接开源智慧
© 2026 GitRead · GitHub 中文社区 本站与 GitHub, Inc. 无隶属关系;GitHub 是 GitHub, Inc. 的商标。