Framework for volatility surface approximation with neural networks. Experience sub-basis-point accuracy with order-of-magnitude speedup over Monte Carlo methods. It includes dataset generators (random grid), neural pricers (grid, pointwise, multi‑regime), Monte Carlo engines for rough/classical models, and post‑processing tools.
Status: research project in progress (APIs may change).
-
Neural pricers
- Grid‑based (dense surface on a T×K grid)
- Pointwise (single queries (
$\theta$ , T, K)) with random grid and time buckets - Multi‑regime (short/mid/long) with automatic routing
- Data generation: Monte Carlo with absorption handling for rough models (long‑term regime)
- Supported processes (excerpt): Rough Bergomi, Rough Heston, Lifted Heston, GBM, jump‑diffusion processes (Kou/Merton)
- Post‑processing: surface interpolation and smile repair modules
- Examples: scripts for stability analysis, MC debugging, and long‑term absorption
Process: Rough Bergomi model (
Performance: MAE = 0.00078, CI Coverage = 89.5%
Experience the framework in action with our interactive demo:
What you'll see:
- Pre-trained neural networks generating volatility surfaces in milliseconds
- Interactive parameter exploration for rough volatility models
- Performance comparisons with traditional Monte Carlo methods
- Real-time implied volatility smile visualization
No installation required - runs entirely in your browser.
- Python >= 3.8.1
- PyTorch >= 1.9, < 3.0
- Numpy, Matplotlib, TQDM
- (Optional) Poetry for environment management
Want to run locally or modify the code? Install the framework:
git clone https://github.com/BianchiGiacomo/deepLearningVolatility.git
cd deepLearningVolatility
poetry install
poetry shellgit clone https://github.com/BianchiGiacomo/deepLearningVolatility.git
cd deepLearningVolatility
pip install -e .After installation, explore these examples to understand the framework:
You can run the ready-to-use scripts in the examples/ folder to explore the framework:
# Analyze temporal discretization optimization across regimes
python examples/MonteCarloDebugger_time_discretization.py
# Long-term absorption analysis (1Y–5Y) with smile comparison
python examples/LongTermRegimeAnalyzer.py
# Test trained pointwise network performance
python examples/pointwise_test_local.py
# Test trained multi-regime network performance
python examples/multiregime_test_local.pyParameters and thresholds can be tweaked directly inside the scripts.
dlvol_MultiRegimeGridPricer.ipynb - Multi-regime training
dlvol_PointwisePricer.ipynb - Pointwise training
To use these notebooks if the repository is private, you must provide a GitHub Personal Access Token (PAT) with scope=repo (or a fine‑grained token with “Contents: Read”) to install the package inside Colab.
For instructions on creating and managing a PAT, see: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
Comprehensive documentation for using the framework and analyzing results lives in the docs/ directory.
For quick, runnable demonstrations that generate plots/tables, use the scripts in examples/ (e.g. MonteCarloDebugger_time_discretization.py).
deepLearningVolatility/
├─ instruments/ # Products and payoffs
├─ nn/
│ ├─ dataset_builder/ # Dataset generators (random grid, time buckets)
│ ├─ modules/bs/ # Black–Scholes modules
│ └─ pricer/ # Neural pricers (grid/pointwise/multi‑regime)
├─ stochastic/
│ ├─ engine.py # Monte Carlo engine
│ ├─ rough_bergomi.py, rough_heston.py, heston.py, ...
│ └─ wrappers/ # Ready‑to‑use process wrappers
├─ examples/ # Ready‑to‑run scripts
├─ images/ # Demonstrative output figures
├─ docs/ # Documentation (if present)
└─ tests/ # Tests
- Grid‑based approach (Horváth–Muguruza–Tomas, 2021)
- Pointwise with random grid (Baschetti–Bormetti–Rossi, 2024)
- Project docs and notes on absorption handling (
docs/andimages/)
See also examples/LongTermRegimeAnalyzer.py to reproduce additional cases mentioned in the docs.
Contributions and issues are welcome.
Open an issue or a pull request describing motivation, impact, and minimal tests.
Please keep code style consistent (black, isort) and pass checks (flake8, mypy).
If you use this repository, please cite:
Bianchi, G. (2025). Deep Learning Volatility (v1.0.0) [Software]. https://doi.org/10.5281/zenodo.17018686
BibTeX
@software{Bianchi_DeepLearningVolatility_2025,
author = {Bianchi, Giacomo},
title = {Deep Learning Volatility},
version = {1.0.0},
year = {2025},
doi = {10.5281/zenodo.17018686},
url = {https://github.com/BianchiGiacomo/deepLearningVolatility}
}MIT — see LICENSE.
