All models

HF TimeSeriesTransformer

A vanilla encoder-decoder Transformer with a distribution head for probabilistic forecasting.

Time series · 247 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
119.4K
Operations
247
Framework
PyTorch
Recurrent
No
Published
2021
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m1296
Graph hash
c3f7662b79bbdd5b3b5c20276c4b14072f30390d153f9a3a2fe54f9eafe7eef3
Skeleton hash
dd558dc45e98745f80f0f33f005e4c02a1cc2a5573ea55e79f5eaad697399bba
Architecture hash
87a1039b031815e101c624f1a9789c175525c2ef2f99482ab872627d8a686d81
Diagram SHA-256
795f5af0a82b438ccef71223ede542e646efd28b4d2a7806d477ebc4674b03b1
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

The Time Series Transformer is a vanilla encoder-decoder Transformer for time series forecasting. The base model is the raw Transformer without any head, and the prediction variant adds a distribution head on top so it can be used for forecasting. That makes it a probabilistic rather than point forecasting model: it learns a distribution from which one can sample, and does not directly output values. The encoder takes a context_length of past values, and the decoder predicts a prediction_length of values into the future.

Temporal features such as day of the month and month of the year serve as positional encodings for the Transformer encoder. Static categorical features, such as the store ID or region ID that identifies a series, can be attached as well. Training uses teacher-forcing, as a Transformer is trained for machine translation. At inference the model samples a prediction for the next time step and feeds it back to the decoder to make the next, which the docs call autoregressive generation.

Key idea. The Time Series Transformer applies the plain encoder-decoder Transformer to forecasting with a distribution head, so it learns a distribution over future values instead of point forecasts.

  • time series transformer
  • timeseriestransformer
  • time_series_transformer
  • probabilistic forecasting
  • time series forecasting
  • encoder-decoder transformer
  • transformers

AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.