百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pytorch-forecasting

> DevOps
开源

使用 PyTorch 的时间序列预测

5.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用 PyTorch 的时间序列预测

PyTorch Forecasting is a PyTorch-based package for forecasting with state-of-the-art deep learning architectures. It provides a high-level API and uses PyTorch Lightning to scale training on GPU or CPU, with automatic logging.

Documentation · Tutorials · Release Notes Open Source Community CI/CD Code Downloads )

Our article on Towards Data Science introduces the package and provides background information.

PyTorch Forecasting aims to ease state-of-the-art timeseries forecasting with neural networks for real-world cases and research alike. The goal is to provide a high-level API with maximum flexibility for professionals and reasonable defaults for beginners. Specifically, the package provides

  • A timeseries dataset class which abstracts handling variable transformations, missing values, randomized subsampling, multiple history lengths, etc.
  • A base model class which provides basic training of timeseries models along with logging in TensorBoard and generic visualizations such as actual vs predictions and dependency plots
  • Multiple neural network architectures for timeseries forecasting that have been enhanced for real-world deployment and come with in-built interpretation capabilities
  • Multi-horizon timeseries metrics
  • Hyperparameter tuning with optuna

The package is built on pytorch-lightning to allow training on CPUs, single and multiple GPUs out-of-the-box.

Installation

If you are working on windows, you need to first install PyTorch with

pip install torch -f https://download.pytorch.org/whl/torch_stable.html.

Otherwise, you can proceed with

pip install pytorch-forecasting

Alternatively, you can install the package via conda

conda install pytorch-forecasting pytorch -c pytorch>=1.7 -c conda-forge

PyTorch Forecasting is now installed from the conda-forge channel while PyTorch is install from the pytorch channel.

To use the MQF2 loss (multivariate quantile loss), also install pip install pytorch-forecasting[mqf2]

Documentation

Visit https://pytorch-forecasting.readthedocs.io to read the documentation with detailed tutorials.

Available models

The documentation provides a comparison of available models.

  • Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting which outperforms DeepAR by Amazon by 36-69% in benchmarks
  • N-BEATS: Neural basis expansion analysis for interpretable time series forecasting which has (if used as ensemble) outperformed all other methods including ensembles of traditional statical methods in the M4 competition. The M4 competition is arguably the most important benchmark for univariate time series forecasting.
  • N-HiTS: Neural Hierarchical Interpolation for Time Series Forecasting which supports covariates and has consistently beaten N-BEATS. It is also particularly well-suited for long-horizon forecasting.
  • DeepAR: Probabilistic forecasting with autoregressive recurrent networks which is the one of the most popular forecasting algorithms and is often used as a baseline
  • PatchTST: A Time Series is Worth 64 Words which achieves state-of-the-art long-term forecasting performance using Transformers with channel independence and patching
  • Simple standard networks for baselining: LSTM and GRU networks as well as a MLP on the decoder
  • A baseline model that always predicts the latest known value

To implement new models or other custom components, see the How to implement new models tutorial. It covers basic as well as advanced architectures.

Usage example

Networks can be trained with the PyTorch Lightning Trainer on pandas Dataframes which are first converted to a TimeSeriesDataSet.

…

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •A timeseries dataset class which abstracts handling variable transformations, missing values,
  • •A base model class which provides basic training of timeseries models along with logging in TensorBoard
  • •Multiple neural network architectures for timeseries forecasting that have been enhanced
  • •Multi-horizon timeseries metrics
  • •Hyperparameter tuning with optuna
  • •Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting
  • •N-BEATS: Neural basis expansion analysis for interpretable time series forecasting
  • •DeepAR: Probabilistic forecasting with autoregressive recurrent networks
  • •PatchTST: A Time Series is Worth 64 Words
  • •Simple standard networks for baselining: LSTM and GRU networks as well as a MLP on the decoder

> 标签

Pythonaiartificial-intelligencedata-sciencedeep-learning

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理