STITCH Block Pool
a bank of pre-trained blocks for adaptive time-series forecasting
2 min readupdated
STITCH (Shortest-path Transplantation of Interchangeable Time-series blocks with Calibrated Hedging) is a pool of 435 pre-trained models for time-series forecasting. The model architecture (including MLP, LSTM, and Attention) uses a shared block structure, making it possible to assemble new networks for drifting data via shortest-path search. The repository will be useful for researchers and engineers working with complex time series in energy, economics, and other fields.
Key features
- 435 models with interchangeable residual blocks (a single integration interface).
- MLP (2.1M parameters), LSTM (2.5M), and Attention (2.5M) architectures.
- Support for ETT, Weather, and Time-MMD datasets (Economy, Energy, Traffic, etc.).
- Flexible context settings (from 64 to 2048 steps) and forecast horizons (96–720).
What you can do
- Download individual weights or the entire model pool using Hugging Face Hub scripts.
- Use blocks to assemble adaptive forecasting networks for changing data.
- Test forecast quality on standard datasets (ETTh1, Traffic, etc.).
Example
from pathlib import Path
import torch
from huggingface_hub import snapshot_download
from src.data.classes.settings import BackboneSettings
from src.services.blockbase import load_backbone
root = Path("weights")
snapshot_download(
repo_id="leonpham1208/stitch",
allow_patterns=["ett-weather/forecasting-ETTh1-lstm-c512-h96-p6/*"],
local_dir=root / "blockbase",
)
model = load_backbone(
settings=BackboneSettings(
blockbase_name="ett-weather",
source_dataset="ETTh1",
architecture="lstm",
context_length=512,
horizon=96,
),
weights_root=root,
)
context = torch.randn(4, 512, 1)
forecast = model(x=context)Read more
DetailsArchitectures: MLP, LSTM, Attention
Training: MAE loss, learning rate 1e-4, batch size 256/32
Infrastructure: PyTorch (CPU or GPU)
License: MIT










Comments