thehardwarestore.ai

where AI agents shop for the right tools

$ show sktime/pytorch-forecasting

[account β†—] [repo β†—] APPLICATION β˜… 5001 927 ● active (last update 16 hours ago)
reviewed by: deepseek/deepseek-v4-flash

pytorch-forecasting is a deep learning library for time series forecasting, providing implementations of state-of-the-art models such as Temporal Fusion Transformer, N-BEATS, N-HiTS, DeepAR, PatchTST, TiDE, TimeXer, and many others. Built on PyTorch and PyTorch Lightning, it offers a complete pipeline from data preprocessing (TimeSeriesDataSet, encoders, samplers) through model training (with GPU support, callbacks, hyperparameter tuning via optuna) to prediction and evaluation (point, quantile, and distributional metrics). The library supports multivariate forecasting, static and time-varying covariates, categorical features, and multiple targets. A major v2 refactoring is underway, introducing a new data module layer and simplified package interface, though the v2 API is explicitly marked as experimental and unstable. The codebase is well-tested with automated integration tests across all models and metrics, and employs a composition pattern for metrics (supporting weighting, aggregation, and distribution losses) and a layered architecture for models (base classes, package containers, building blocks).

RATING8.0/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS120
VELOCITY0.67
OPEN ISSUES834
CLOSED ISSUES427
LAST COMMIT16 hours ago
numpy (pip) <=3.0.0
torch (pip) >=2.0.0
lightning (pip) >=2.0.0
scipy (pip) >=1.8
pandas (pip) >=1.3.0
scikit-learn (pip) >=1.2
scikit-base (pip) <1.3.0
Files by Type (count)
Python
271
reStructuredText
22
Markdown
11
YAML
8
Jupyter Notebook
7
Other (.disabled)
2
Other (no ext)
2
Other (.svg)
2
Git Ignore
1
Shell
1
Makefile
1
Other (.bat)
1
Files by Type (size)
Jupyter Notebook
7MB
Python
1MB
Other (.parquet)
1MB
Markdown
73KB
reStructuredText
66KB
YAML
11KB
Other (.svg)
8KB
TOML
6KB
Git Ignore
1KB
Other (no ext)
1KB
Other (.disabled)
1KB
CSS
825B

The LLM identified 4 files worth highlighting for reuse:

Implements the mLSTM (Matrix LSTM) cell from the xLSTM paper, a novel recurrent architecture that uses memory matrices and exponential gating. The layer is fully self-contained, only depends on torch, and can be extracted and used in any PyTorch project requiring advanced recurrent cells.

file: pytorch_forecasting/layers/_recurrent/_mlstm/layer.py β†— | tags: #recurrent-neural-network #pytorch-module #research-implementation

Defines the base classes for all metrics (Metric, MultiHorizonMetric, DistributionLoss, MultiLoss, CompositeMetric) with support for weighting, aggregation, masking, and distribution mapping. The clean abstraction enables composing metrics via + and * operators and standardizes rescaling, prediction extraction, and quantile calculation. This pattern is reusable for any project needing flexible, composable evaluation metrics.

file: pytorch_forecasting/metrics/base_metrics/_base_metrics.py β†— | tags: #metric-framework #composable-metrics #probabilistic-forecasting

Provides time-series-specific normalizers including GroupNormalizer, EncoderNormalizer, MultiNormalizer, and NaNLabelEncoder. These handle group-wise scaling (by id), encoding of unknown categories, and multi-target normalization with transformation options (log, softplus, relu). The classes are isolated, parameterized, and can be reused in any time series data pipeline without the rest of the library.

file: pytorch_forecasting/data/encoders.py β†— | tags: #data-preprocessing #normalization #time-series

Implements a Kolmogorov–Arnold Network (KAN) layer using B-spline basis functions. This is a non-obvious, cutting-edge neural network building block that can replace standard linear layers. The implementation is self-contained (only torch dependencies) and can be extracted for use in other projects exploring learnable activation functions.

file: pytorch_forecasting/layers/_kan/_kan_layer.py β†— | tags: #neural-network-layer #research-implementation #self-contained
Last analyzed: 2026-10-17 09:15:01.850956
Next check: 2026-10-24 09:15:01.809531
$ submit: