Skip to main content

A Python library that implements ״Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting״

Project description

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 (link to follow soon) 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/PlaytikaResearch/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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tft_torch-0.0.3.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

tft_torch-0.0.3-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file tft_torch-0.0.3.tar.gz.

File metadata

  • Download URL: tft_torch-0.0.3.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for tft_torch-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a84cda7faae3116bb71ccc3c365f8484d0eb936e5e14a345a0dca144fec1d3e1
MD5 a2fb71c632801161d8ed3f0d201f40ba
BLAKE2b-256 09ccc53b276ecb5648a7abcd11fc8359722f0040d1d3ecc4dbe335cf9326d4ae

See more details on using hashes here.

File details

Details for the file tft_torch-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tft_torch-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for tft_torch-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0aea40c064f90d9b23bfec1a0eaf93247ec9f71383d93ce281c39e70fcbd25e9
MD5 100bda8e4a724c9a8b85d480cea73b34
BLAKE2b-256 ac365c3d485e7bad1280591c319b64cea2c2963b8f81e93a7ad19ebd469b57e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page