pad_array
dataset.py
Makes sure that the series length is divisible by the patch_stride by adding left-padding.
| Parameter | Type | Default | Description |
|---|---|---|---|
values |
Shaped[torch.Tensor, "*batch variates series_len"] |
- | - |
patch_stride |
int |
- | - |
Returns: Shaped[torch.Tensor, "*batch variates padded_length"]
pad_id_mask
dataset.py
Makes sure that the series length is divisible by the patch_stride by adding left-padding to the id mask. It does this by repeating the leftmost value of the id mask for each variate
| Parameter | Type | Default | Description |
|---|---|---|---|
id_mask |
Int[torch.Tensor, "*batch variates series_len"] |
- | - |
patch_stride |
int |
- | - |
Returns: Int[torch.Tensor, "*batch variates padded_length"]
MaskedTimeseries
dataset.py · inherits NamedTuple
(No prose description provided in docstring.)
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
series |
Float[torch.Tensor, "*batch variates series_len"] |
- | The time series data. When using exogenous variables, they MUST be placed at the END of the variates dimension (last num_exogenous_variables channels). |
padding_mask |
Bool[torch.Tensor, "*batch variates series_len"] |
- | A mask that indicates which values are padding. If padding_mask[..., i] is True, then series[..., i] is NOT padding; i.e., it's a valid value in the time series. |
id_mask |
Int[torch.Tensor, "*batch variates #series_len"] |
- | A mask that indicates the group ID of each variate. Any variates with the same ID are considered to be part of the same multivariate time series, and can attend to each other. Note: the #series_len dimension can be 1 if the IDs should be broadcast across the time dimension. |
timestamp_seconds |
Int[torch.Tensor, "*batch variates series_len"] |
- | A POSIX timestamp in seconds for each time step in the series. |
time_interval_seconds |
Int[torch.Tensor, "*batch variates"] |
- | The time frequency of each variate in seconds |
num_exogenous_variables |
int |
0 |
Number of exogenous variates (covariates) in the series. These are the last num_exogenous_variables channels. During autoregressive decoding, their future values are injected from future_exogenous_variables instead of being predicted. |
to(self, device)
(No prose summary.)
| Parameter | Type | Default | Description |
|---|---|---|---|
device |
torch.device |
- | (undocumented) |
Returns: MaskedTimeseries
is_extreme_value
dataset.py
(No prose summary.)
| Parameter | Type | Default | Description |
|---|---|---|---|
t |
torch.Tensor |
- | (undocumented) |
Returns: torch.Tensor
replace_extreme_values
dataset.py
(No prose summary.)
| Parameter | Type | Default | Description |
|---|---|---|---|
t |
torch.Tensor |
- | (undocumented) |
replacement |
float |
0.0 |
(undocumented) |
Returns: torch.Tensor