tsfastis an open-source deep learning library for time series analysis and system identification tasks. Built on PyTorch, 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 PyTorch, it
provides efficient implementations of various deep learning models and
utilities.
- Specialized Data Handling — HDF5-backed data pipeline with sequence transforms, noise injection, normalization, and TBPTT (Truncated Backpropagation Through Time) support.
- Benchmark Datasets — One-line access to Silverbox,
Wiener-Hammerstein, Cascaded Tanks, and more via
identibench. - Time Series Models — RNNs (DenseNet, Residual), TCNs, CRNNs with layer normalization, and combined architectures.
- Integrated Training —
RNNLearner,TCNLearner,CRNNLearnerwith custom losses (nrmse,cut_loss) and composable transforms. - System Identification — Simulation, N-step prediction, FranSys,
and autoregressive models with
InferenceWrapperfor deployment. - Physics-Informed NNs — Embed governing equations into training
via
CollocationLoss,PhysicsLoss, andPIRNN. - Hyperparameter Optimization — Ray Tune integration via
HPOptimizer. - Deployment — Model save/load,
InferenceWrapperfor NumPy-in/NumPy-out inference, and ONNX export. - Performance — CUDA graph acceleration via
GraphedStatefulModelfor low-overhead GPU training.
You can install the latest stable version using:
pip install tsfastFor development installation:
git clone https://github.com/daniel-om-weber/tsfast
cd tsfast
pip install -e '.[dev]'
# or using uv:
uv sync --extra devHere is a quick example using a benchmark dataloader. It demonstrates loading and visualizing data, training a RNN, and visualizing the results.
from tsfast.basics import *
# Load benchmark dataset
dls = create_dls_silverbox()
# Train an RNN and visualize results
lrn = RNNLearner(dls)
lrn.fit_flat_cos(1)
lrn.show_results(max_n=1)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.
If you use tsfast in your research, please cite:
@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}
}
