quantlab.model.torch_training#

Training pieces a TorchModel head may pick for its hooks.

The data a head is fed (the training panel, Batch and the datasets) lives in quantlab.model.torch_data. This module holds the pieces of a head’s learning strategy:

  • cs_rank_norm, cs_zscore and drop_extreme are target transforms for a head’s _transform_target.

  • masked_mse is a loss for a head’s _loss.

  • TrainLossThreshold is MASTER’s stopping rule, a helper for a head’s stop hooks.

Everything a head picks is optional to use: the hooks may be written from scratch.

Classes

TrainLossThreshold

MASTER's stopping rule, for a head's stop hooks.

Functions

cs_rank_norm

Qlib's CSRankNorm of one bar's [S_t, L] labels, column by column.

cs_zscore

Z-score of one bar's [S_t, L] labels, column by column.

drop_extreme

Return the rows kept after dropping both tails of one label column.

masked_mse

Mean squared error over the entries where mask is True.