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

Official repository of "DeepMIH: Deep Invertible Network for Multiple Image Hiding", TPAMI 2022.

DeepMIH: Deep Invertible Network for Multiple Image Hiding (TPAMI 2022) This repo is the official code for DeepMIH: Deep Invertible Network for Multip

Junpeng Jing 67 Nov 22, 2022
Temporal Knowledge Graph Reasoning Triggered by Memories

MTDM Temporal Knowledge Graph Reasoning Triggered by Memories To alleviate the time dependence, we propose a memory-triggered decision-making (MTDM) n

4 Sep 25, 2022
Experiments with differentiable stacks and queues in PyTorch

Please use stacknn-core instead! StackNN This project implements differentiable stacks and queues in PyTorch. The data structures are implemented in s

Will Merrill 141 Oct 06, 2022
EMNLP 2020 - Summarizing Text on Any Aspects

Summarizing Text on Any Aspects This repo contains preliminary code of the following paper: Summarizing Text on Any Aspects: A Knowledge-Informed Weak

Bowen Tan 35 Nov 14, 2022
This repository contains the code for the paper ``Identifiable VAEs via Sparse Decoding''.

Sparse VAE This repository contains the code for the paper ``Identifiable VAEs via Sparse Decoding''. Data Sources The datasets used in this paper wer

Gemma Moran 17 Dec 12, 2022
Code for Emergent Translation in Multi-Agent Communication

Emergent Translation in Multi-Agent Communication PyTorch implementation of the models described in the paper Emergent Translation in Multi-Agent Comm

Facebook Research 75 Jul 15, 2022
SegTransVAE: Hybrid CNN - Transformer with Regularization for medical image segmentation

SegTransVAE: Hybrid CNN - Transformer with Regularization for medical image segmentation This repo is the official implementation for SegTransVAE. Seg

Nguyen Truong Hai 4 Aug 04, 2022
Model Zoo for MindSpore

Welcome to the Model Zoo for MindSpore In order to facilitate developers to enjoy the benefits of MindSpore framework, we will continue to add typical

MindSpore 226 Jan 07, 2023
Official Pytorch implementation of "Learning to Estimate Robust 3D Human Mesh from In-the-Wild Crowded Scenes", CVPR 2022

Learning to Estimate Robust 3D Human Mesh from In-the-Wild Crowded Scenes / 3DCrowdNet News 💪 3DCrowdNet achieves the state-of-the-art accuracy on 3D

Hongsuk Choi 113 Dec 21, 2022
This repo is customed for VisDrone.

Object Detection for VisDrone(无人机航拍图像目标检测) My environment 1、Windows10 (Linux available) 2、tensorflow = 1.12.0 3、python3.6 (anaconda) 4、cv2 5、ensemble

53 Jul 17, 2022
A simple, fast, and efficient object detector without FPN

You Only Look One-level Feature (YOLOF), CVPR2021 A simple, fast, and efficient object detector without FPN. This repo provides an implementation for

789 Jan 09, 2023
⚖️🔁🔮🕵️‍♂️🦹🖼️ Code for *Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances* paper.

Measuring the Contribution of Multiple Model Representations in Detecting Adversarial Instances This repository contains the code for Measuring the Co

Daniel Steinberg 0 Nov 06, 2022
A GUI to automatically create a TOPAS-readable MLC simulation file

Python script to create a TOPAS-readable simulation file descriring a Multi-Leaf-Collimator. Builds the MLC using the data from a 3D .stl file.

Sebastian Schäfer 0 Jun 19, 2022
PyTorch Implementation of [1611.06440] Pruning Convolutional Neural Networks for Resource Efficient Inference

PyTorch implementation of [1611.06440 Pruning Convolutional Neural Networks for Resource Efficient Inference] This demonstrates pruning a VGG16 based

Jacob Gildenblat 836 Dec 26, 2022
Build a medical knowledge graph based on Unified Language Medical System (UMLS)

UMLS-Graph Build a medical knowledge graph based on Unified Language Medical System (UMLS) Requisite Install MySQL Server 5.6 and import UMLS data int

Donghua Chen 6 Dec 25, 2022
Official Codes for Graph Modularity:Towards Understanding the Cross-Layer Transition of Feature Representations in Deep Neural Networks.

Dynamic-Graphs-Construction Official Codes for Graph Modularity:Towards Understanding the Cross-Layer Transition of Feature Representations in Deep Ne

11 Dec 14, 2022
Run object detection model on the Raspberry Pi

Using TensorFlow Lite with Python is great for embedded devices based on Linux, such as Raspberry Pi.

Dimitri Yanovsky 6 Oct 08, 2022
Lingvo is a framework for building neural networks in Tensorflow, particularly sequence models.

Lingvo is a framework for building neural networks in Tensorflow, particularly sequence models.

2.7k Jan 05, 2023
Image Captioning on google cloud platform based on iot

Image-Captioning-on-google-cloud-platform-based-on-iot - Image Captioning on google cloud platform based on iot

Shweta_kumawat 1 Jan 20, 2022