Skip to main content

tft-torch

alt text alt text alt text alt text

tft-torch is a Python library that implements "Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting" using pytorch framework. The library provides a complete implementation of a time-series multi-horizon forecasting model with state-of-the-art performance on several benchmark datasets.

This library works for Python 3.7 and higher and PyTorch 1.6.0 and higher.

Installation

This library is distributed on PyPi and can be installed using pip.

$ pip install tft-torch 

The command above will automatically install all the required dependencies. Please visit the installation page for more details.

Getting started

Check out the tutorials for a demonstration how to use the library.

Documentation

For more information, refer to our blogpost and complete documentation.

Reference

This repository suggests an implementation of a model based on the work presented in the following paper:

@misc{lim2020temporal,
      title={Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting}, 
      author={Bryan Lim and Sercan O. Arik and Nicolas Loeff and Tomas Pfister},
      year={2020},
      eprint={1912.09363},
      archivePrefix={arXiv},
      primaryClass={stat.ML}
}

Some parts of the implementation rely on mattsherar's TFT implementation, available as part of the Temporal_Fusion_Transform repository.

Info for developers

The source code of the project is available on GitHub.

$ git clone https://github.com/PlaytikaOSS/tft-torch.git

You can install the library and the dependencies with one of the following commands:

$ pip install .                        # install library + dependencies
$ pip install ".[develop]"             # install library + dependencies + developer-dependencies
$ pip install -r requirements.txt      # install dependencies
$ pip install -r requirements-dev.txt  # install developer-dependencies

For creating the "pip-installable" *.whl file, run the following command (at the root of the repository):

$ python -m build

For creating the HTML documentation of the project, run the following commands:

$ cd docs
$ make clean
$ make html

Run tests

Tests can be executed with pytest running the following commands:

$ cd tests
$ pytest                                      # run all tests
$ pytest test_testmodule.py                   # run all tests within a module
$ pytest test_testmodule.py -k test_testname  # run only 1 test

License

MIT License

Release files for tft-torch 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tft-torch 0.0.6
File Size Uploaded
tft_torch-0.0.6.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tft-torch 0.0.6
File Interpreter ABI Platform
tft_torch-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 46.1 kB

Release files / tft_torch-0.0.6.tar.gz

Download URL tft_torch-0.0.6.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e6c3bb1f42cfa755956bb754cd29c624a551b399fc427df62c25b0d1ec2db15d
BLAKE2b-256 checksum
How to use checksums
dab718eccc411d815fa71738da3c8f734aa90c5051ce52bc193030df1812b906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0

Release files / tft_torch-0.0.6-py3-none-any.whl

Download URL tft_torch-0.0.6-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cc4246c78636979b0657b1f5d957204b41bd04344200b9fcc2d00df4f41a21d
BLAKE2b-256 checksum
How to use checksums
8df367aacfbfea782852f95d6871e10efda2769f3c888d43784c05318b87ac9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page