tsfast


Nametsfast JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/daniel-om-weber/tsfast
SummaryA description of your project
upload_time2025-07-23 13:47:28
maintainerNone
docs_urlNone
authorDaniel Oliver Martin Weber
requires_python>=3.10
licenseApache Software License 2.0
keywords fastai time-series system-identification deep-learning pytorch fransys
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

<img src="https://raw.githubusercontent.com/daniel-om-weber/tsfast/refs/heads/master/assets/logo.svg" width="200" align="left" alt="tsfast logo">

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## TSFast

[![PyPI
version](https://badge.fury.io/py/tsfast.svg)](https://badge.fury.io/py/tsfast)
[![License: Apache
2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Docs
Status](https://img.shields.io/badge/docs-up_to_date-brightgreen.svg)](https://daniel-om-weber.github.io/tsfast/)
[![Python
Versions](https://img.shields.io/pypi/pyversions/tsfast.png)](https://pypi.org/project/tsfast/)

## Description

> `tsfast` is an open-source deep learning library for time series
> analysis and system identification tasks. Built on PyTorch & fastai,
> it offers efficient deep learning models and utilities.

`tsfast` is an open-source deep learning package that focuses on system
identification and time series analysis tasks. Built on the foundations
of PyTorch and fastai, it provides efficient implementations of various
deep learning models and utilities.

## Key Features

- **Specialized Data Handling for Time Series**:
  - Employs `SequenceBlock` (built on `fastai.TransformBlock`) for
    robust sequence data processing pipelines.
  - Includes a range of transforms tailored for sequences, such as
    `SeqSlice`, `SeqNoiseInjection`, and `Normalize` adapted for time
    series tensors.
  - Features advanced data loading with `TbpttDl` (for Truncated
    Backpropagation Through Time), and factories for `WeightedDL` and
    `BatchLimitDL`.
- **Predefined Datasets & Helpers**: Offers easy-to-use benchmark
  datasets (e.g., `create_dls_silverbox` from `identibench`) for rapid
  prototyping and experimentation.
- **Tailored Time Series Models**: Provides implementations of Recurrent
  Neural Networks (RNNs, including
  [`DenseNet_RNN`](https://daniel-om-weber.github.io/tsfast/03_models/rnn.html#densenet_rnn),
  [`ResidualBlock_RNN`](https://daniel-om-weber.github.io/tsfast/03_models/rnn.html#residualblock_rnn)),
  Convolutional Neural Networks (TCNs,
  [`CausalConv1d`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#causalconv1d)),
  and combined architectures
  ([`CRNN`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#crnn),
  [`SeperateCRNN`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#seperatecrnn))
  specifically designed for sequence modeling. Includes building blocks
  like
  [`SeqLinear`](https://daniel-om-weber.github.io/tsfast/03_models/layers.html#seqlinear)
  and stateful batch normalization.
- **Integrated `fastai` Learner**: Features
  [`RNNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#rnnlearner),
  [`TCNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#tcnlearner),
  [`CRNNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#crnnlearner),
  etc., extending `fastai`’s `Learner` for streamlined model training,
  equipped with custom time-series losses (e.g.,
  [`fun_rmse`](https://daniel-om-weber.github.io/tsfast/02_learner/losses.html#fun_rmse),
  [`nrmse`](https://daniel-om-weber.github.io/tsfast/02_learner/losses.html#nrmse))
  and callbacks (e.g.,
  [`TbpttResetCB`](https://daniel-om-weber.github.io/tsfast/00_data/loader.html#tbpttresetcb),
  [`ARInitCB`](https://daniel-om-weber.github.io/tsfast/02_learner/callbacks.html#arinitcb),
  [`SkipFirstNCallback`](https://daniel-om-weber.github.io/tsfast/02_learner/callbacks.html#skipfirstncallback)).
- **System Identification & Prediction**:
  - Supports simulation (prediction based on inputs) and N-step ahead
    forecasting.
  - Includes specialized models and callbacks for system identification
    tasks like FRANSYS (`FranSys`, `FranSysCallback`) and AR models
    (`AR_Model`, `ARProg`).
  - Provides an `InferenceWrapper` for easier model deployment and
    prediction.
- **Hyperparameter Optimization**: Integrates with Ray Tune via
  [`HPOptimizer`](https://daniel-om-weber.github.io/tsfast/tune.html#hpoptimizer)
  for efficient hyperparameter searching.

## Installation

You can install the **latest stable** version from pip using:

``` python
pip install tsfast
```

For development installation:

``` python
git clone https://github.com/daniel-om-weber/tsfast
cd tsfast
pip install -e '.[dev]'
```

## Quick Start

Here is a quick example using a benchmark dataloader. It demonstrates
loading and visualizing data, training a RNN, and visualizing the
results.

``` python
from tsfast.basics import *
dls = create_dls_silverbox()
dls.show_batch(max_n=1)
```

![](index_files/figure-commonmark/cell-2-output-1.png)

``` python
lrn = RNNLearner(dls)
lrn.fit_flat_cos(1)
```

<style>
    /* Turns off some styling */
    progress {
        /* gets rid of default border in Firefox and Opera. */
        border: none;
        /* Needs to be in here for Safari polyfill so background images work as expected. */
        background-size: auto;
    }
    progress:not([value]), progress:not([value])::-webkit-progress-bar {
        background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);
    }
    .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {
        background: #F44336;
    }
</style>

| epoch | train_loss | valid_loss | fun_rmse | time  |
|-------|------------|------------|----------|-------|
| 0     | 0.006716   | 0.006925   | 0.015471 | 01:55 |

``` python
lrn.show_results(max_n=1)
```

<style>
    /* Turns off some styling */
    progress {
        /* gets rid of default border in Firefox and Opera. */
        border: none;
        /* Needs to be in here for Safari polyfill so background images work as expected. */
        background-size: auto;
    }
    progress:not([value]), progress:not([value])::-webkit-progress-bar {
        background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);
    }
    .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {
        background: #F44336;
    }
</style>

![](index_files/figure-commonmark/cell-4-output-3.png)

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
For major changes, please open an issue first to discuss what you would
like to change.

## Citation

If you use tsfast in your research, please cite:

``` text
@Misc{tsfast,
author = {Daniel O.M. Weber},
title = {tsfast - A deep learning library for time series analysis and system identification},
howpublished = {Github},
year = {2024},
url = {https://github.com/daniel-om-weber/tsfast}
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/daniel-om-weber/tsfast",
    "name": "tsfast",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "fastai time-series system-identification deep-learning pytorch fransys",
    "author": "Daniel Oliver Martin Weber",
    "author_email": "daniel.om.weber@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/01/0f/acc506e072b2e6e6d382a76353eb10a44f7e4fdc3f02ae26f7b64b9aaa96/tsfast-0.1.6.tar.gz",
    "platform": null,
    "description": "\n\n<img src=\"https://raw.githubusercontent.com/daniel-om-weber/tsfast/refs/heads/master/assets/logo.svg\" width=\"200\" align=\"left\" alt=\"tsfast logo\">\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## TSFast\n\n[![PyPI\nversion](https://badge.fury.io/py/tsfast.svg)](https://badge.fury.io/py/tsfast)\n[![License: Apache\n2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Docs\nStatus](https://img.shields.io/badge/docs-up_to_date-brightgreen.svg)](https://daniel-om-weber.github.io/tsfast/)\n[![Python\nVersions](https://img.shields.io/pypi/pyversions/tsfast.png)](https://pypi.org/project/tsfast/)\n\n## Description\n\n> `tsfast` is an open-source deep learning library for time series\n> analysis and system identification tasks. Built on PyTorch & fastai,\n> it offers efficient deep learning models and utilities.\n\n`tsfast` is an open-source deep learning package that focuses on system\nidentification and time series analysis tasks. Built on the foundations\nof PyTorch and fastai, it provides efficient implementations of various\ndeep learning models and utilities.\n\n## Key Features\n\n- **Specialized Data Handling for Time Series**:\n  - Employs `SequenceBlock` (built on `fastai.TransformBlock`) for\n    robust sequence data processing pipelines.\n  - Includes a range of transforms tailored for sequences, such as\n    `SeqSlice`, `SeqNoiseInjection`, and `Normalize` adapted for time\n    series tensors.\n  - Features advanced data loading with `TbpttDl` (for Truncated\n    Backpropagation Through Time), and factories for `WeightedDL` and\n    `BatchLimitDL`.\n- **Predefined Datasets & Helpers**: Offers easy-to-use benchmark\n  datasets (e.g., `create_dls_silverbox` from `identibench`) for rapid\n  prototyping and experimentation.\n- **Tailored Time Series Models**: Provides implementations of Recurrent\n  Neural Networks (RNNs, including\n  [`DenseNet_RNN`](https://daniel-om-weber.github.io/tsfast/03_models/rnn.html#densenet_rnn),\n  [`ResidualBlock_RNN`](https://daniel-om-weber.github.io/tsfast/03_models/rnn.html#residualblock_rnn)),\n  Convolutional Neural Networks (TCNs,\n  [`CausalConv1d`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#causalconv1d)),\n  and combined architectures\n  ([`CRNN`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#crnn),\n  [`SeperateCRNN`](https://daniel-om-weber.github.io/tsfast/03_models/cnn.html#seperatecrnn))\n  specifically designed for sequence modeling. Includes building blocks\n  like\n  [`SeqLinear`](https://daniel-om-weber.github.io/tsfast/03_models/layers.html#seqlinear)\n  and stateful batch normalization.\n- **Integrated `fastai` Learner**: Features\n  [`RNNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#rnnlearner),\n  [`TCNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#tcnlearner),\n  [`CRNNLearner`](https://daniel-om-weber.github.io/tsfast/02_learner/learner.html#crnnlearner),\n  etc., extending `fastai`\u2019s `Learner` for streamlined model training,\n  equipped with custom time-series losses (e.g.,\n  [`fun_rmse`](https://daniel-om-weber.github.io/tsfast/02_learner/losses.html#fun_rmse),\n  [`nrmse`](https://daniel-om-weber.github.io/tsfast/02_learner/losses.html#nrmse))\n  and callbacks (e.g.,\n  [`TbpttResetCB`](https://daniel-om-weber.github.io/tsfast/00_data/loader.html#tbpttresetcb),\n  [`ARInitCB`](https://daniel-om-weber.github.io/tsfast/02_learner/callbacks.html#arinitcb),\n  [`SkipFirstNCallback`](https://daniel-om-weber.github.io/tsfast/02_learner/callbacks.html#skipfirstncallback)).\n- **System Identification & Prediction**:\n  - Supports simulation (prediction based on inputs) and N-step ahead\n    forecasting.\n  - Includes specialized models and callbacks for system identification\n    tasks like FRANSYS (`FranSys`, `FranSysCallback`) and AR models\n    (`AR_Model`, `ARProg`).\n  - Provides an `InferenceWrapper` for easier model deployment and\n    prediction.\n- **Hyperparameter Optimization**: Integrates with Ray Tune via\n  [`HPOptimizer`](https://daniel-om-weber.github.io/tsfast/tune.html#hpoptimizer)\n  for efficient hyperparameter searching.\n\n## Installation\n\nYou can install the **latest stable** version from pip using:\n\n``` python\npip install tsfast\n```\n\nFor development installation:\n\n``` python\ngit clone https://github.com/daniel-om-weber/tsfast\ncd tsfast\npip install -e '.[dev]'\n```\n\n## Quick Start\n\nHere is a quick example using a benchmark dataloader. It demonstrates\nloading and visualizing data, training a RNN, and visualizing the\nresults.\n\n``` python\nfrom tsfast.basics import *\ndls = create_dls_silverbox()\ndls.show_batch(max_n=1)\n```\n\n![](index_files/figure-commonmark/cell-2-output-1.png)\n\n``` python\nlrn = RNNLearner(dls)\nlrn.fit_flat_cos(1)\n```\n\n<style>\n    /* Turns off some styling */\n    progress {\n        /* gets rid of default border in Firefox and Opera. */\n        border: none;\n        /* Needs to be in here for Safari polyfill so background images work as expected. */\n        background-size: auto;\n    }\n    progress:not([value]), progress:not([value])::-webkit-progress-bar {\n        background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n    }\n    .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n        background: #F44336;\n    }\n</style>\n\n| epoch | train_loss | valid_loss | fun_rmse | time  |\n|-------|------------|------------|----------|-------|\n| 0     | 0.006716   | 0.006925   | 0.015471 | 01:55 |\n\n``` python\nlrn.show_results(max_n=1)\n```\n\n<style>\n    /* Turns off some styling */\n    progress {\n        /* gets rid of default border in Firefox and Opera. */\n        border: none;\n        /* Needs to be in here for Safari polyfill so background images work as expected. */\n        background-size: auto;\n    }\n    progress:not([value]), progress:not([value])::-webkit-progress-bar {\n        background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n    }\n    .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n        background: #F44336;\n    }\n</style>\n\n![](index_files/figure-commonmark/cell-4-output-3.png)\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\nFor major changes, please open an issue first to discuss what you would\nlike to change.\n\n## Citation\n\nIf you use tsfast in your research, please cite:\n\n``` text\n@Misc{tsfast,\nauthor = {Daniel O.M. Weber},\ntitle = {tsfast - A deep learning library for time series analysis and system identification},\nhowpublished = {Github},\nyear = {2024},\nurl = {https://github.com/daniel-om-weber/tsfast}\n}\n```\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "A description of your project",
    "version": "0.1.6",
    "project_urls": {
        "Homepage": "https://github.com/daniel-om-weber/tsfast"
    },
    "split_keywords": [
        "fastai",
        "time-series",
        "system-identification",
        "deep-learning",
        "pytorch",
        "fransys"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "25427209ebaf6a3bbb55bfd5b6dbdd93f4e2d5d8325c746224ef517b3b7c5735",
                "md5": "b7ea0b7fbd563debef91f81ae9999d81",
                "sha256": "bf5cad784056f042adc3cd64fba2e302dd73b0bfd0264fbb06e242d927469280"
            },
            "downloads": -1,
            "filename": "tsfast-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b7ea0b7fbd563debef91f81ae9999d81",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 72698,
            "upload_time": "2025-07-23T13:47:26",
            "upload_time_iso_8601": "2025-07-23T13:47:26.839821Z",
            "url": "https://files.pythonhosted.org/packages/25/42/7209ebaf6a3bbb55bfd5b6dbdd93f4e2d5d8325c746224ef517b3b7c5735/tsfast-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "010facc506e072b2e6e6d382a76353eb10a44f7e4fdc3f02ae26f7b64b9aaa96",
                "md5": "db6973adefaf1a40691f02d4882e61f7",
                "sha256": "d500eea5c59bf43f4181d5f461273fc5db421e03e7342b67f13ae20e0c888edf"
            },
            "downloads": -1,
            "filename": "tsfast-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "db6973adefaf1a40691f02d4882e61f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15416420,
            "upload_time": "2025-07-23T13:47:28",
            "upload_time_iso_8601": "2025-07-23T13:47:28.959823Z",
            "url": "https://files.pythonhosted.org/packages/01/0f/acc506e072b2e6e6d382a76353eb10a44f7e4fdc3f02ae26f7b64b9aaa96/tsfast-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-23 13:47:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "daniel-om-weber",
    "github_project": "tsfast",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tsfast"
}
        
Elapsed time: 1.51650s