jzinnegger / differential-ml

Differential machine learning in Keras / Tensorflow 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Differential deep learning with autodiff and autoencoder

The notebook PCAandAutoencoder.ipynb provides an alternative technical implementation of the diffential machine learning approach by Brian Huge and Antoine Savine (see Working paper [1] and Risk [3]) and builds on examples and implementations provided in the differential machine learning GitHub [2]. The notebook is executable in Colab without additional setup.

Main features of the notebook come with the use of the Keras model framework in Tensorflow 2. The notebook provides two alternative implementations for the backpropagation:

  • An explicit backpropagation implemented as additional network on top of the feedforward model (aka the twin net). The equation for one step in the backpropagation scheme is encapsulated in a custom layer.
  • The utilisation of the reverse automatic differentation that is build-in in tensorflow. The backpropagation is implemented as an inner (gradient) tape in a custom Keras layer.

The original implementation in [2] includes an example of an equity basket priced with a Bachielier model. The generating model is reused in the notebook. Huge/Savine describe a powerful differential PCA as a pre-processing step on values and differentials. This notebook takes an ad-hoc approach and implements an autoencoder as the first layer, specifically to limit the dimensions to the (hopefully) most important latent variables.

BS Example

The tensorboard logs of the training are available at tensorboard.dev for interactive analysis.

A write up of the implementation is http://ssrn.com/abstract=3788904.

An additional notebook Illustrations provides an illustration of the pathwise regression on the example of an European BS option.

About

Differential machine learning in Keras / Tensorflow 2

License:MIT License


Languages

Language:Jupyter Notebook 99.9%Language:Python 0.1%