Giter VIP home page Giter VIP logo

differential-machine-learning / notebooks Goto Github PK

View Code? Open in Web Editor NEW
134.0 15.0 51.0 52.83 MB

Implement, demonstrate, reproduce and extend the results of the Risk articles 'Differential Machine Learning' (2020) and 'PCA with a Difference' (2021) by Huge and Savine, and cover implementation details left out from the papers.

Home Page: https://arxiv.org/abs/2005.02347

Jupyter Notebook 100.00%
quantitative-finance computational-finance derivatives risk-management pricing machine-learning deep-learning automatic-differentiation aad tensorflow

notebooks's Introduction

notebooks


These notebooks complement the Risk papers Differential Machine Learning and Axes that matter by Brian Huge and Antoine Savine (2020-21), including code, practical implementation considerations and extensions.

DifferentialML.ipynb is the main demonstration notebook for the concepts and ideas of the working paper. We provide a simple, yet fully functional implementation of twin networks and differential training, and apply them to some textbook examples, including the reproduction of the Bachelier example in the section 3.1 of the article. We also discuss the details of a practical implementation, including the important matters of initialization, optimization and normalization, which are not covered in the paper. This notebook is based on TensorFlow 1.x and built to run on GPU, either locally or on Google Colab.

Open In Colab

DifferentialMLTF2.ipynb is an upgrade to DifferentialML.ipynb for TensorFlow 2.x. Its current form does not run 'idiomatic' TensorFLow 2 code, what we do is really run TensorFlow 1 code in TensorFlow 2. Still, the new notebook benefits from the latest TensorFlow improvements resulting in a noticeable performance improvement. DifferentialML.ipynb will no longer be maintained going forward, bug fixes, improvements and extensions will be implemented directly in the TensorFlow 2 notebook.

Open In Colab

DifferentialRegression.ipynb applies differential learning in the context of classic regression models. In the article, we applied differential learning to deep neural networks only. This notebook applies it to polynomial regression to the basket option in a correlated Bachelier model of section 3,1. We see that, with regression too, differential training provides a massive performance improvement, without the need for additional regularization, or hyperparameter optimization. Differential regression is covered in detail in the upcoming follow-up article Axes that matter: PCA with a difference.

Open In Colab

DifferentialPCA.ipynb implements and illustrates differential dimension reduction covered in the follow-up article Axes that matter: PCA with a difference.

Open In Colab

Bermudan5F.ipynb applies differential regression and PCA to the determination of risk factors and continuation values of Bermudan options, giving a flavour of the application of differential ML to real-world problems. Factor dependence of Derivatives transactions and trading books, in particular, is usually identified by manual analysis. This notebook leverages synthetic data simulated with AAD, and the differential ML algorithms designed to correctly consume differential data, to perform this analysis automatically, from simulated data, with guaranteed reliability. This notebook uses differential regression and PCA developed in DifferentialRegression.ipynb and DifferentialPCA.ipynb, and it is recommended to read these two notebooks first. The numerical examples of the October 2021 Risk article Axes that matter: PCA with a difference were produced with this notebook.

Open In Colab

We also posted additional material here, including mathematical proofs, various extensions and considerations for an implementation in production.

github.com/differential-machine-learning

notebooks's People

Contributors

asavine avatar brnohu avatar differential-machine-learning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notebooks's Issues

Storing fitting model parameters

Is there a simple way to modify the code in DifferentialMLTF2.ipynb to store the fitted neural net and load the stored parameters back into the regressor for later prediction?

hi

can you provide this code in pytorch .thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.