seasonality_model#

tfts.layers.nbeats_layer.seasonality_model(theta: Tensor, t_b: Tensor, t_f: Tensor, config_per_harmonic: int, backcast_cos_template: Tensor, backcast_sin_template: Tensor, forecast_cos_template: Tensor, forecast_sin_template: Tensor) Tuple[Tensor, Tensor][source]#

Generate the seasonality backcast and forecast using Fourier basis functions.

Parameters:
  • theta (tf.Tensor) – Basis expansion coefficients

  • t_b (tf.Tensor) – Input time index for backcast

  • t_f (tf.Tensor) – Output time index for forecast

  • config_per_harmonic (int) – Number of coefficients per harmonic

  • backcast_cos_template (tf.Tensor) – Cosine template for backcast

  • backcast_sin_template (tf.Tensor) – Sine template for backcast

  • forecast_cos_template (tf.Tensor) – Cosine template for forecast

  • forecast_sin_template (tf.Tensor) – Sine template for forecast

Returns:

A tuple of (backcast, forecast) tensors

Return type:

Tuple[tf.Tensor, tf.Tensor]