Pretrained Models¶
Pretrained StrataNet weights are available on Hugging Face Hub at emylton/strata-net.
Available Models¶
| File | Asset | Volatility Profile | Training Data |
|---|---|---|---|
aapl_net.pt |
AAPL | Medium (large-cap tech) | 3,000 synthetic bars |
tsla_net.pt |
TSLA | High (growth/momentum) | 3,000 synthetic bars |
spy_net.pt |
SPY | Low (broad market ETF) | 3,000 synthetic bars |
nvda_net.pt |
NVDA | High (semiconductor) | 3,000 synthetic bars |
qqq_net.pt |
QQQ | Medium (tech ETF) | 3,000 synthetic bars |
btc_net.pt |
BTC | High (crypto) | 3,000 synthetic bars |
All models: ~5,000 parameters, seq_len=30, trained for 40 epochs.
Load from Hugging Face¶
from huggingface_hub import hf_hub_download
from strata import StrataNet
# Download and load
path = hf_hub_download(repo_id="emylton/strata-net", filename="aapl_net.pt")
model = StrataNet.load(path)
print(model.summary())
# StrataNet v1.0
# asset : AAPL
# seq_len : 30
# hidden_dim : 4 [bias, momentum, trap_risk, uncertainty]
# parameters : 5,020
Quick inference¶
import torch
from strata.net_trainer import _normalise_window
# Prepare 30-bar window
x = torch.tensor(_normalise_window(candles[-30:]), dtype=torch.float32)
result = model.predict_action(x)
print(result["action"]) # "LONG" / "SHORT" / "HOLD"
print(result["confidence"]) # 0.71
print(result["regime"]) # "TRENDING"
print(result["state"]) # {"bias": 0.82, "momentum": 0.45, ...}
Fine-tune on your data¶
The pretrained models are trained on synthetic data with realistic volatility profiles. For best results on real data, fine-tune on your own historical data:
from strata import StrataNetTrainer, StrataNetDataset
dataset = StrataNetDataset.from_candles(my_real_candles, seq_len=30, asset="AAPL")
trainer = StrataNetTrainer(model=model, lr=1e-4) # low LR = fine-tune
model = trainer.train(dataset, epochs=10)
model.save("aapl_finetuned.pt")