Deep BSDE Solver in TensorFlow/Pytorch
- I recommend doing installation in a virtual environment such as Anaconda, Python 3.9 is used in this implementation.
- Install PyTorch
conda install cudatoolkit=11.8
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
- Clone this repository
git clone https://github.com/Jerome-Cong/DeepBSDE.git
pip3 install -e .
- With TensorFlow:
python main.py --config_path=configs/hjb_lq_d100.json- With PyTorch:
python main_torch.py --config_path=configs/hjb_lq_d100.jsonCommand-line flags:
config_path: Config path corresponding to the partial differential equation (PDE) to solve. There are seven PDEs implemented so far. See Problems section below.exp_name: Name of numerical experiment, prefix of logging and output.log_dir: Directory to write logging and output array.
equation.py and config.py now support the following problems:
Three examples in ref [1]:
HJBLQ: Hamilton-Jacobi-Bellman (HJB) equation.AllenCahn: Allen-Cahn equation with a cubic nonlinearity.PricingDefaultRisk: Nonlinear Black-Scholes equation with default risk in consideration.
Four examples in ref [2]:
PricingDiffRate: Nonlinear Black-Scholes equation for the pricing of European financial derivatives with different interest rates for borrowing and lending.BurgersType: Multidimensional Burgers-type PDEs with explicit solution.QuadraticGradient: An example PDE with quadratically growing derivatives and an explicit solution.ReactionDiffusion: Time-dependent reaction-diffusion-type example PDE with oscillating explicit solutions.
New problems can be added very easily. Inherit the class equation
in equation.py and define the new problem. Note that the generator function
and terminal function should be TensorFlow operations while the sample function
can be python operation. A proper config is needed as well.
[1] Han, J., Jentzen, A., and E, W. Overcoming the curse of dimensionality: Solving high-dimensional partial differential equations using deep learning,
Proceedings of the National Academy of Sciences, 115(34), 8505-8510 (2018). [journal] [arXiv]
[2] E, W., Han, J., and Jentzen, A. Deep learning-based numerical methods for high-dimensional parabolic partial differential equations and backward stochastic differential equations,
Communications in Mathematics and Statistics, 5, 349โ380 (2017).
[journal] [arXiv]
deepbsde's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
OpenClaw
Personal AI Assistant
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.