Downloads · 30 days
11
7% of all-time downloads
itsalissonsilva/modern-tcn-probabilistic
modern-tcn-probabilistic is a feature extraction model from itsalissonsilva. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
Downloads · 30 days
11
7% of all-time downloads
All-time downloads
156
Public
Parameters
543K
2.2 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.2 MB · 99%
From the Hugging Face model README
The backbone of this model is based on:
This version is adapted for probabilistic forecasting. Instead of only predicting future values, it predicts a Gaussian distribution for each future step and each variable.
Give the model a window of past values and it returns:
loc: the predicted meanscale: the predicted standard deviationThat means you get both a forecast and uncertainty bands.
The current checkpoint in this repo is a starter model trained on the hourly ETTh1 benchmark. It is a practical first release, not a heavily tuned benchmark run.
This model is a good fit for:
Input:
past_values: [batch_size, context_length, num_input_channels]Optional training target:
future_values: [batch_size, prediction_length, num_input_channels]Output:
loc: [batch_size, prediction_length, num_input_channels]scale: [batch_size, prediction_length, num_input_channels]loss: scalar, when future_values is providedCurrent released checkpoint details:
ETTh151296HUFL,HULL,MUFL,MULL,LUFL,LULL,OTRevINAdamW1e-332stage_dims=[16, 32, 64]blocks_per_stage=[1, 1, 2]1This checkpoint was trained on CPU-friendly settings so we could get a complete end-to-end model ready for the Hub.
These are the numbers for the current starter checkpoint:
| Split | Dataset | Horizon | MAE | RMSE | NLL |
|---|---|---|---|---|---|
| Validation | ETTh1 | 96 | 1.6252 | 3.0474 | 0.8281 |
| Test | ETTh1 | 96 | 1.7555 | 3.0745 | 1.0163 |
For reference, this is a probabilistic adaptation of ModernTCN, so point-forecast metrics from the original paper are only a rough reference point, not a direct apples-to-apples comparison.
import torch
from transformers import AutoModel
model = AutoModel.from_pretrained(
"your-username/modern-tcn-probabilistic-etth1-cpu-starter",
trust_remote_code=True,
)
past_values = torch.randn(1, 512, 7)
outputs = model(past_values=past_values)
print(outputs.loc.shape)
print(outputs.scale.shape)
If you want simple Gaussian uncertainty bands:
lower_95 = outputs.loc - 1.96 * outputs.scale
upper_95 = outputs.loc + 1.96 * outputs.scale
If you want forecast samples:
samples = model.sample(past_values, num_samples=100)
print(samples.shape)
The training script supports:
.csv with a header row.npy shaped [time, channels].npz with a values array or a single 2D arrayExample:
python scripts/train.py --data-path data/series.csv --timestamp-column timestamp --value-columns load,temperature,price --context-length 512 --prediction-length 96 --epochs 20 --batch-size 32 --output-dir runs/modern-tcn-probabilistic
After training, the script writes:
runs/.../best_modelruns/.../last_modelruns/.../history.jsonruns/.../summary.jsonruns/.../data_config.jsonIf you want dataset-level scaling:
python scripts/train.py --data-path data/series.csv --normalization standard
If you use this model, please cite the original ModernTCN paper:
@inproceedings{
donghao2024moderntcn,
title={Modern{TCN}: A Modern Pure Convolution Structure for General Time Series Analysis},
author={Donghao Luo and Xue Wang},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=vpJMJerXHU}
}