How vib28/layatrainer works
Laya Trainer is a Stage A supervised stock-movement prediction system. Its main workflow loads local market bars, prepares features and forward-looking targets, builds chronological datasets, trains a multi-task model, and evaluates predictions and simulated trading performance. The README documents the pipeline; sampled source confirms key model, training, evaluation, simulator, ledger, and adapter responsibilities. Some orchestration and subsystem wiring is based on the README because main.py excerpts are incomplete.
Main entry points: main.py Pipeline runner · evaluate.py Metrics and benchmarks · data_loader.py Load and align bars · train.py Training loop
Components 16
Market data prep
- Load and align bars
data_loader.py - Market features
features.py - Forward labels
labels.py - Feature scaling
normalize.py - Chronological splits
dataset.py
Supervised learning
- Prediction network
model.py - Training loop
train.py
Evaluation and simulation
- Metrics and benchmarks
evaluate.py - Trade replay
simulator.py - Portfolio accounting
ledger.py - Evaluation reports
evaluate.py
Model extension
- Laya hybrid adapter
laya_adapter.py
Other components
- Researcher
- Local market CSVs
- Pipeline runner
main.py - Experiment configuration
config.py
Connections 21
- Researcher → Pipeline runner: runs pipeline
- Local market CSVs → Load and align bars: loads bars
- Pipeline runner → Load and align bars: loads data
- Pipeline runner → Market features: builds features
- Pipeline runner → Forward labels: builds targets
- Pipeline runner → Feature scaling: scales features
- Pipeline runner → Chronological splits: creates splits
- Load and align bars → Market features: provides bars
- Load and align bars → Forward labels: provides bars
- Pipeline runner → Training loop: trains model
- Chronological splits → Training loop: provides batches
- Training loop → Prediction network: optimizes
- Pipeline runner → Metrics and benchmarks: evaluates model
- Chronological splits → Metrics and benchmarks: provides test batches
- Metrics and benchmarks → Trade replay: simulates trades
- Trade replay → Portfolio accounting: updates portfolio
- Metrics and benchmarks → Evaluation reports: reports metrics
- Pipeline runner → Experiment configuration: reads settings
- Training loop → Experiment configuration: reads settings
- Metrics and benchmarks → Experiment configuration: reads settings
- Laya hybrid adapter → Prediction network: alternative architecture