Core Concepts
The minimum machine-learning vocabulary you need to reason clearly about NeuraLib models, datasets, tensors, and training behavior.
Five essential ideas
| Term | Meaning |
|---|---|
| Feature | A number supplied as input: RSI, return, distance from an EMA, volatility, or any value known at that moment. |
| Target | The answer the model should learn: next-bar return, a future price, or a class such as Bear / Neutral / Bull. |
| Loss | A differentiable score measuring how wrong the output was. Training tries to reduce it. |
| Training | A forward pass followed by backpropagation and an optimizer update to the model’s parameters. |
| Prediction | Inference: running new features through the current weights without learning from a target. |
One supervised example
Suppose you want to classify whether price will be bullish, neutral, or bearish eight bars from now. At anchor bar t, you save only information available at t: returns, volatility, and moving-average context. At t + 8, the outcome is finally known, so you create the target and pair it with the old feature row.
- Feature time: the anchor bar where inputs are observed.
- Resolution time: the later bar where the outcome becomes known.
- Training time: any time after resolution; never before.
Tensors and shapes
A Tensor stores values plus shape metadata. A four-feature live input may be a vector with shape [4]. A batch of 32 four-feature examples has shape [32, 4]. A sequence can remain a matrix or be flattened when a model block expects timeSteps × featureCount inputs.
Shape contracts
- The model input width must match the dataset feature width.
- The model output width must match the target width.
- Conv1D, LSTM, and GRU builders validate flattened sequence size.
- Attention builders validate row width and head divisibility.
Parameters and gradients
Dense, convolutional, recurrent, and attention blocks contain trainable parameters, including weights and biases. During backpropagation, NeuraLib’s graph engine computes how much each parameter contributed to the loss. Those derivatives are gradients. The optimizer converts gradients into weight updates.
Learning rate controls update size. Gradient clipping limits unstable updates. Regularization such as dropout or AdamW weight decay reduces overfitting pressure, but cannot replace good data design.
The complete research loop
- Define a causal feature and target specification.
- Collect resolved examples in chronological order.
- Fit scalers only from the training side of the split.
- Train on batches, then evaluate on untouched validation rows.
- Watch validation behavior, not only training loss.
- Run live inference with the exact feature order and scaler used during training.