Skip to main content
The TimesNet univariate model tackles the challenge of modeling multiple intraperiod and interperiod temporal variations. The architecture has the following distinctive features: - An embedding layer that maps the input sequence into a latent space. - Transformation of 1D time seires into 2D tensors, based on periods found by FFT. - A convolutional Inception block that captures temporal variations at different scales and between periods. References Figure 1. TimesNet Architecture. Figure 1. TimesNet Architecture.

1. TimesNet

TimesNet

Bases: BaseModel TimesNet The TimesNet univariate model tackles the challenge of modeling multiple intraperiod and interperiod temporal variations. Parameters:

TimesNet.fit

Fit. The fit method, optimizes the neural network’s weights using the initialization parameters (learning_rate, windows_batch_size, …) and the loss function as defined during the initialization. Within fit we use a PyTorch Lightning Trainer that inherits the initialization’s self.trainer_kwargs, to customize its inputs, see PL’s trainer arguments. The method is designed to be compatible with SKLearn-like classes and in particular to be compatible with the StatsForecast library. By default the model is not saving training checkpoints to protect disk memory, to get them change enable_checkpointing=True in __init__. Parameters: Returns:

TimesNet.predict

Predict. Neural network prediction with PL’s Trainer execution of predict_step. Parameters: Returns:

Usage Example

2. Auxiliary Functions

Inception_Block_V1

Bases: Module Inception_Block_V1

TimesBlock

Bases: Module TimesBlock

FFT_for_Period