
time_series_transformer
Time series306 ops119.7K params
A vanilla encoder-decoder Transformer with a distribution head for probabilistic forecasting.
Time series · 247 operations Checked
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.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
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.
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.