Views
No views yet
| Parameter | Value |
|---|---|
| Lookback Window | 96 trading days |
| Prediction Horizon | 5 trading days |
| Hidden Dim (d_model) | 64 |
| FFN Dim (d_ff) | 128 |
| Attention Heads | 8 |
| Encoder Layers | 2 |
| Patch Length | 16 |
| Stride | 8 |
| Token Blend Size | 2 |
| EMA Alpha | 0.9 |
| Dynamic Projection Rank | 8 |
| Dropout | 0.3 |
| Metric | Value |
|---|---|
| MSE | 0.039362 |
| MAE | 0.132980 |
| RMSE | 0.198398 |
1import torch, json
2from card_nse_predictor import CARD, CARDConfig
3
4# Load config
5with open("config.json") as f:
6 cfg = CARDConfig(**json.load(f))
7
8# Load model
9model = CARD(cfg)
10model.load_state_dict(torch.load("model.pt", map_location="cpu"))
11model.eval()
12
13# Input: (batch, n_stocks, lookback_days) — raw close prices
14# Output: (batch, n_stocks, pred_len) — predicted close prices
15x = torch.randn(1, 20, 96)
16pred = model(x)
17print(pred.shape) # (1, 20, 5)1@inproceedings{xue2024card,
2 title={CARD: Channel Aligned Robust Blend Transformer for Time Series Forecasting},
3 author={Xue, Wang and Zhou, Tian and Wen, Qingsong and Gao, Jinyang and Ding, Bolin and Jin, Rong},
4 booktitle={International Conference on Learning Representations},
5 year={2024}
6}