quantlab.model.predefined.rnn.ALSTMRegressor#

class quantlab.model.predefined.rnn.ALSTMRegressor(config)[source]#

Bases: _QlibRNNHead

Qlib’s ALSTM benchmark model on (bar, symbol) samples.

ALSTMNet, a GRU by default as in Qlib’s benchmark (rnn_type, "GRU" or "LSTM"), trained like LSTMRegressor. Hyperparameters, with Qlib’s Alpha158 benchmark values (workflow_config_alstm_Alpha158.yaml) as defaults: window_bars (20), hidden_size (64), num_layers (2), dropout (0.0), batch_size (800), lr (1e-3), weight_decay (0.0), epochs (200) and early_stop (10). The known differences are LSTMRegressor’s.

Parameters:
configModelConfig

Factors, labels, dates and hyperparameters.

Examples

>>> ALSTMRegressor(config).collect().train().name
'ALSTMRegressor_total.pth'
DEFAULTS = {'batch_size': 800, 'dropout': 0.0, 'early_stop': 10, 'epochs': 200, 'hidden_size': 64, 'lr': 0.001, 'num_layers': 2, 'weight_decay': 0.0, 'window_bars': 20}#

Every unset hyperparameter’s value; a head gives Qlib’s benchmark values.

net_cls#

alias of ALSTMNet

rnn_type = 'GRU'#

The recurrent network the head builds.