Alternatives to Deep Neural Networks for Function Approximations in Finance

Related tags

Deep Learningaltnnpub
Overview

Alternatives to Deep Neural Networks for Function Approximations in Finance

Code companion repo

Overview

This is a repository of Python code to go with our paper whose details could be found below

We provide our implementations of the generalized stochastic sampling (gSS) and functional Tensor Train (fTT) algorithms from the paper, and related routines. This is a somewhat simplified version of the code that produced the test results that we reported. Simplifications were made to improve clarity and increase general didactic value, at a (small) expense of cutting out some of the secondary tricks and variations.

The code is released under the MIT License

Installing the code

You do not have to install this package once you have downloaded it -- see the next section on how to use it without any installation. But if you want to call our routines from a different project or directory, execute the following (note you need to run this from altnnpub directory, assuming this is the root of the project directory -- the directory where this file that you are reading is located)

altnnpub>pip install -e .

Then you can call various methods from your code like this

from nnu import gss_kernels
kernel = gss_kernels.global_kernel_dict(1.0)['invquad']
...

to uninstall the package, run (from anywhere)

blah>pip uninstall altnnpub

Running the code

The main entry point to the code is main.py in ./nnu folder. Assuming the project directory is called altnnpub, the code is run via Python module syntax

altnnpub>python -m nnu.main

Various options such as which functions to fit, which models to use, and so on can be set in main.py

Results are reported in the terminal and are also stored in ./results directory

All of our (non-test) Python code is in ./nnu directory

Jupyter notebooks

We provide a number of notebooks that demonstrate, at varying levels of detail, how to build and use certain models

  • ftt_als_01.ipynb: Functional Tensor Train (fTT) approximation using the Alternating Least Squares (ALS) algorithm
  • functional_2D_low_rank_01.ipynb: Low-rank functional approximation of 2D functions done manually. This is an illustrative example of ALS applied to calculate successive rank-1 approximations, as described in the paper
  • gss_example_keras_direct_01.ipynb: Create and test the generalized Stochastic Sampling (gSS) model. In this notebook do it "by hand", ie using granular interfaces such as the Keras functional interface. Here we create a hidim version of the model with the Adam optimizer for the frequency bounds (aka scales) and linear regression for the outer (linear) weights
  • gss_example_model_factory_01.ipynb: Create and test the generalized Stochastic Sampling (gSS) model. This notebook uses gss_model_factory and other higher-level interfaces that the main entry point (./nnu/main.py) eventually calls. We create a onedim version of the model with a one-dim optimizer for the frequency bounds (aka scales) and linear regression for the outer (linear) weights

Test suite

Unit tests are collected in ./test directory and provide useful examples of how different parts of the code can be used. The test suite can be run in the standard Python way using pytest, e.g. from the comamnd line at the project root directory:

altnnpub>pytest

Pytest is installed with pip install pytest command

Individual tests can be run using a pytest -k test_blah type command, which could be useful for debugging. This is all very well explained in pytest documentation

Tests are there predominantly to show how to call certain functions. They mostly test that the code simply runs rather than testing numbers, etc. except for tests in test_gss_report_generator.py where actual fitting results are compared to the expected ones. Tests produce various output that could be interesting to see -- option pytest -s will print out whatever the tests are printing out

Requirements

The code has been tested with Python 3.7 and 3.8. See requirements.txt for required packages

Contacting us

Our contact details are in the SSRN link below

Details of the paper

Antonov, Alexandre and Piterbarg, Vladimir, Alternatives to Deep Neural Networks for Function Approximations in Finance (November 7, 2021). Available at SSRN: https://ssrn.com/abstract=3958331 or http://dx.doi.org/10.2139/ssrn.3958331

Aesara is a Python library that allows one to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.

Aesara is a Python library that allows one to define, optimize, and efficiently evaluate mathematical expressions involving multi-dimensional arrays.

Aesara 898 Jan 07, 2023
CN24 is a complete semantic segmentation framework using fully convolutional networks

Build status: master (production branch): develop (development branch): Welcome to the CN24 GitHub repository! CN24 is a complete semantic segmentatio

Computer Vision Group Jena 123 Jul 14, 2022
A PyTorch implementation of " EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks."

EfficientNet A PyTorch implementation of EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. [arxiv] [Official TF Repo] Implemen

AhnDW 298 Dec 10, 2022
Does Pretraining for Summarization Reuqire Knowledge Transfer?

Pretraining summarization models using a corpus of nonsense

Approximately Correct Machine Intelligence (ACMI) Lab 12 Dec 19, 2022
PyElastica is the Python implementation of Elastica, an open-source software for the simulation of assemblies of slender, one-dimensional structures using Cosserat Rod theory.

PyElastica PyElastica is the python implementation of Elastica: an open-source project for simulating assemblies of slender, one-dimensional structure

Gazzola Lab 105 Jan 09, 2023
Code for TIP 2017 paper --- Illumination Decomposition for Photograph with Multiple Light Sources.

Illumination_Decomposition Code for TIP 2017 paper --- Illumination Decomposition for Photograph with Multiple Light Sources. This code implements the

QAY 7 Nov 15, 2020
Unsupervised Representation Learning via Neural Activation Coding

Neural Activation Coding This repository contains the code for the paper "Unsupervised Representation Learning via Neural Activation Coding" published

yookoon park 5 May 26, 2022
ivadomed is an integrated framework for medical image analysis with deep learning.

Repository on the collaborative IVADO medical imaging project between the Mila and NeuroPoly labs.

144 Dec 19, 2022
COD-Rank-Localize-and-Segment (CVPR2021)

COD-Rank-Localize-and-Segment (CVPR2021) Simultaneously Localize, Segment and Rank the Camouflaged Objects Full camouflage fixation training dataset i

JingZhang 52 Dec 20, 2022
Sign Language is detected in realtime using video sequences. Our approach involves MediaPipe Holistic for keypoints extraction and LSTM Model for prediction.

RealTime Sign Language Detection using Action Recognition Approach Real-Time Sign Language is commonly predicted using models whose architecture consi

Rishikesh S 15 Aug 20, 2022
Sibur challange 2021 competition - 6 place

sibur challange 2021 Решение на 6 место: https://sibur.ai-community.com/competitions/5/tasks/13 Скор 1.4066/1.4159 public/private. Архитектура - однос

Ivan 5 Jan 11, 2022
This is a Keras-based Python implementation of DeepMask- a complex deep neural network for learning object segmentation masks

NNProject - DeepMask This is a Keras-based Python implementation of DeepMask- a complex deep neural network for learning object segmentation masks. Th

189 Nov 16, 2022
StableSims is an open-source project aimed at simulating MakerDAO's Dai stablecoin system

StableSims is an open-source project aimed at simulating MakerDAO's Dai stablecoin system, initially used for researching optimal incentive parameters for Liquidations 2.0.

Blockchain at Berkeley 52 Nov 21, 2022
This is project is the implementation of the DeepShift: Towards Multiplication-Less Neural Networks paper

DeepShift This is project is the implementation of the DeepShift: Towards Multiplication-Less Neural Networks paper, that aims to replace multiplicati

Mostafa Elhoushi 88 Dec 23, 2022
Tensorflow implementation for "Improved Transformer for High-Resolution GANs" (NeurIPS 2021).

HiT-GAN Official TensorFlow Implementation HiT-GAN presents a Transformer-based generator that is trained based on Generative Adversarial Networks (GA

Google Research 78 Oct 31, 2022
Code for the paper "Learning-Augmented Algorithms for Online Steiner Tree"

Learning-Augmented Algorithms for Online Steiner Tree This is the code for the paper "Learning-Augmented Algorithms for Online Steiner Tree". Requirem

0 Dec 09, 2021
Codes for paper "Towards Diverse Paragraph Captioning for Untrimmed Videos". CVPR 2021

Towards Diverse Paragraph Captioning for Untrimmed Videos This repository contains PyTorch implementation of our paper Towards Diverse Paragraph Capti

Yuqing Song 61 Oct 11, 2022
Contrastively Disentangled Sequential Variational Audoencoder

Contrastively Disentangled Sequential Variational Audoencoder (C-DSVAE) Overview This is the implementation for our C-DSVAE, a novel self-supervised d

Junwen Bai 35 Dec 24, 2022
Official Implementation of VAT

Semantic correspondence Few-shot segmentation Cost Aggregation Is All You Need for Few-Shot Segmentation For more information, check out project [Proj

Hamacojr 114 Dec 27, 2022
A clean and robust Pytorch implementation of PPO on continuous action space.

PPO-Continuous-Pytorch I found the current implementation of PPO on continuous action space is whether somewhat complicated or not stable. And this is

XinJingHao 56 Dec 16, 2022