Downloads · 30 days
0
gulnawaz123/Features_Pretrain_30m_2
Features_Pretrain_30m_2 is a machine learning model from gulnawaz123. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A patch-based Transformer (LPatchTST) trained on NIFTY 50 30-minute bars for directional signal prediction.
Downloads · 30 days
0
Access
Public
Updated Jun 16, 2026
Repo size
1.2 MB
Likes
0
Public
Click a slice to open those files.
.pth1.2 MB · 87%
From the Hugging Face model README
A patch-based Transformer (LPatchTST) trained on NIFTY 50 30-minute bars for directional signal prediction.
| File | Description |
|---|---|
best_model_lpatchtst.pth | Best fine-tuned checkpoint |
pretrained_lpatchtst.pth | Pre-trained backbone checkpoint |
config.py | Hyperparameters & architecture config |
model.py | Model definition |
import torch
import sys
sys.path.insert(0, ".") # ensure local modules are importable
import config
from model import LPatchTST
net = LPatchTST(
input_mode=config.INPUT_MODE,
seq_len=config.LOOKBACK_WINDOW,
n_features=0, # set to your feature count
s1_bits=config.TOKENIZER_S1_BITS,
s2_bits=config.TOKENIZER_S2_BITS,
d_model=config.D_MODEL,
patch_len=config.PATCH_LEN,
stride=config.STRIDE,
n_heads=config.N_HEADS,
n_layers=config.N_LAYERS,
lstm_layers=config.LSTM_LAYERS,
dropout=config.FINETUNE_DROPOUT,
aggregation=config.AGGREGATION_MODE,
)
state = torch.load("best_model_lpatchtst.pth", map_location="cpu")
net.load_state_dict(state)
net.eval()