Downloads · 30 days
9
16% of all-time downloads
FareedKhan/timesfm-from-scratch-70m
timesfm-from-scratch-70m is a time series forecasting model from FareedKhan. Use it for the time series forecasting task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A from-scratch reimplementation of Google's TimesFM time-series foundation model, trained with a custom pretraining pipeline rebuilt from the paper (arXiv:2310.10688). This checkpoint is the 70M (small) configuration.
Downloads · 30 days
9
16% of all-time downloads
All-time downloads
55
Public
Parameters
67.8M
543 MB on disk
Likes
1
Public
Click a slice to open those files.
.pt271 MB · 50%
From the Hugging Face model README
A from-scratch reimplementation of Google's TimesFM time-series foundation model, trained with a
custom pretraining pipeline rebuilt from the paper (arXiv:2310.10688). This checkpoint is the 70M
(small) configuration.
docs/PROJECT_JOURNEY.md in the code repo.It takes the recent history of a single numeric series (for example the last 512 points) and predicts the next 96 to 192 values, zero-shot, with a point forecast and 9 quantiles.
Zero-shot ETT (never trained on), standardized MAE, even-window protocol:
| Model | Params | ETT MAE | vs naive | vs seasonal-naive |
|---|---|---|---|---|
| Last-value naive | n/a | 0.298 | 1.00 | |
| Seasonal-naive | n/a | 0.272 | 0.91 | 1.00 |
| This model | 70M | 0.246 | 0.83 | 0.90 |
| Google TimesFM (released) | 200M | 0.215 (published) | reference |
The improvement over both baselines is statistically significant under a paired bootstrap test. It does not overfit (flat through 120k steps) and generalizes across structured domains.
# 1) get the code: https://github.com/FareedKhan-dev/timesfm-from-scratch (add src/ to your path)
# 2) load the weights:
import torch
from huggingface_hub import hf_hub_download
from tsfm import config
from tsfm.model import build_model
ckpt = hf_hub_download("FareedKhan/timesfm-from-scratch-70m", "pytorch_model.pt")
model = build_model(config.small())
model.load_state_dict(torch.load(ckpt, map_location="cpu")["model"])
model.eval()
context = torch.randn(1, 512) # your last 512 points, standardized
point, quantiles = model.forecast(context, 96) # next 96 steps: point + 9 quantiles
MIT. Reimplements ideas from TimesFM (Google) for research and education; not affiliated with Google.