quantlab.model.predefined.transformer#
Qlib’s Transformer and Localformer benchmark models.
TransformerNet reproduces the Transformer network of
qlib/contrib/model/pytorch_transformer_ts.py (Vaswani et al., “Attention Is
All You Need”, 2017) and LocalformerNet the one of
pytorch_localformer_ts.py (Jiang et al.), which adds a convolution beside
every encoder layer and a GRU after the encoder. TransformerRegressor and
LocalformerRegressor train them with Qlib’s time-series regimen
(QlibSequenceHead) and its defaults, which the Alpha158 benchmark config
keeps.
Classes
Qlib's Localformer encoder: each layer reads its input plus a convolution of it. |
|
Qlib's Localformer ( |
|
Qlib's Localformer benchmark model on |
|
Qlib's sinusoidal position encoding of time-major |
|
Qlib's |
|
Qlib's Transformer benchmark model on |