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

Contrastive Learning Inverts the Data Generating Process

Official code to reproduce the results and data presented in the paper Contrastive Learning Inverts the Data Generating Process.

71 Nov 25, 2022
Pytorch re-implementation of Paper: SwinTextSpotter: Scene Text Spotting via Better Synergy between Text Detection and Text Recognition (CVPR 2022)

SwinTextSpotter This is the pytorch implementation of Paper: SwinTextSpotter: Scene Text Spotting via Better Synergy between Text Detection and Text R

mxin262 183 Jan 03, 2023
Predicting future trajectories of people in cameras of novel scenarios and views.

Pedestrian Trajectory Prediction Predicting future trajectories of pedestrians in cameras of novel scenarios and views. This repository contains the c

8 Sep 03, 2022
Code for ACM MM2021 paper "Complementary Trilateral Decoder for Fast and Accurate Salient Object Detection"

CTDNet The PyTorch code for ACM MM2021 paper "Complementary Trilateral Decoder for Fast and Accurate Salient Object Detection" Requirements Python 3.6

CVTEAM 28 Oct 20, 2022
Efficient Sparse Attacks on Videos using Reinforcement Learning

EARL This repository provides a simple implementation of the work "Efficient Sparse Attacks on Videos using Reinforcement Learning" Example: Demo: Her

12 Dec 05, 2021
Code for our paper "MG-GAN: A Multi-Generator Model Preventing Out-of-Distribution Samples in Pedestrian Trajectory Prediction" published at ICCV 2021.

MG-GAN: A Multi-Generator Model Preventing Out-of-Distribution Samples in Pedestrian Trajectory Prediction This repository contains the code for the p

Sven 30 Jan 05, 2023
Code for the paper: On Pathologies in KL-Regularized Reinforcement Learning from Expert Demonstrations

Non-Parametric Prior Actor-Critic (N-PPAC) This repository contains the code for On Pathologies in KL-Regularized Reinforcement Learning from Expert D

Cong Lu 5 May 13, 2022
Ranger deep learning optimizer rewrite to use newest components

Ranger21 - integrating the latest deep learning components into a single optimizer Ranger deep learning optimizer rewrite to use newest components Ran

Less Wright 266 Dec 28, 2022
Generates all variables from your .tf files into a variables.tf file.

tfvg Generates all variables from your .tf files into a variables.tf file. It searches for every var.variable_name in your .tf files and generates a v

1 Dec 01, 2022
Self-Learning - Books Papers, Courses & more I have to learn soon

Self-Learning This repository is intended to be used for personal use, all rights reserved to respective owners, please cite original authors and ask

Achint Chaudhary 968 Jan 02, 2022
A Conditional Point Diffusion-Refinement Paradigm for 3D Point Cloud Completion

A Conditional Point Diffusion-Refinement Paradigm for 3D Point Cloud Completion This repo intends to release code for our work: Zhaoyang Lyu*, Zhifeng

Zhaoyang Lyu 68 Jan 03, 2023
Code for training and evaluation of the model from "Language Generation with Recurrent Generative Adversarial Networks without Pre-training"

Language Generation with Recurrent Generative Adversarial Networks without Pre-training Code for training and evaluation of the model from "Language G

Amir Bar 253 Sep 14, 2022
Alphabetical Letter Recognition

BayeesNetworks-Image-Classification Alphabetical Letter Recognition In these demo we are using "Bayees Networks" Our database is composed by Learning

Mohammed Firass 4 Nov 30, 2021
This is the official code for the paper "Tracker Meets Night: A Transformer Enhancer for UAV Tracking".

SCT This is the official code for the paper "Tracker Meets Night: A Transformer Enhancer for UAV Tracking" The spatial-channel Transformer (SCT) enhan

Intelligent Vision for Robotics in Complex Environment 27 Nov 23, 2022
SkipGNN: Predicting Molecular Interactions with Skip-Graph Networks (Scientific Reports)

SkipGNN: Predicting Molecular Interactions with Skip-Graph Networks Molecular interaction networks are powerful resources for the discovery. While dee

Kexin Huang 49 Oct 15, 2022
「PyTorch Implementation of AnimeGANv2」を用いて、生成した顔画像を元の画像に上書きするデモ

AnimeGANv2-Face-Overlay-Demo PyTorch Implementation of AnimeGANv2を用いて、生成した顔画像を元の画像に上書きするデモです。

KazuhitoTakahashi 21 Oct 18, 2022
Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices, ACM Multimedia 2021

Codes for ECBSR Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices Xindong Zhang, Hui Zeng, Lei Zhang ACM Multimedia 202

xindong zhang 236 Dec 26, 2022
百度2021年语言与智能技术竞赛机器阅读理解Pytorch版baseline

项目说明: 百度2021年语言与智能技术竞赛机器阅读理解Pytorch版baseline 比赛链接:https://aistudio.baidu.com/aistudio/competition/detail/66?isFromLuge=true 官方的baseline版本是基于paddlepadd

周俊贤 54 Nov 23, 2022
Official implementation of "Learning to Discover Cross-Domain Relations with Generative Adversarial Networks"

DiscoGAN Official PyTorch implementation of Learning to Discover Cross-Domain Relations with Generative Adversarial Networks. Prerequisites Python 2.7

SK T-Brain 754 Dec 29, 2022