tsts.collators

Functions

class tsts.collators.build_collator[source]

Build collator.

To configure collator, change lines which start with “_CN.COLLATOR”. For other settings not written in global configuration, refer to from_cfg method of each class.

Parameters

cfg (CN) – Global configuration

Returns

Built collator

Return type

Collator

__init__(**kwargs)

Classes

class tsts.collators.Collator[source]

Basic collator.

Padding works as the following example:

If lookback is 4 but the length of input time series is 2 e.g. [1, 2] (we remove feature dimension for simplicity), it adds 0 paddings to the left i.e. [0, 0, 1, 2]. Instead of it, if horizon is 4 but the length of output time series is 2 e.g. [1, 2], it adds 0 paddings to the right i.e. [1, 2, 0, 0]. masks are used to specify which time steps are valid (not padded). For the examples above, masks for padded input time series and output time series are [0, 0, 1, 1] and [1, 1, 0, 0].

Parameters
  • lookback (int, optional) – Number of input time steps, by default 100

  • horizon (int, optional) – Number of output time steps, by default 1

__init__(lookback: int = 100, horizon: int = 1) None[source]
classmethod from_cfg(cfg: yacs.config.CfgNode) tsts.collators.collator.Collator[source]

Build Collator from config.

Returns

Built collator

Return type

Collator