gulnawaz123/Features_Pretrain_30m_2
0
LPatchTST — NIFTY 50 Trading Model
A patch-based Transformer (LPatchTST) trained on NIFTY 50 30-minute bars for directional signal prediction.
Files
Loading the model
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()