code: def __init__(
      self,
      units,
      thetas_dim=None,
      num_block_layers=4,
      backcast_length=10,
      forecast_length=5,
      nb_harmonics=None,
      min_period=1,
      dropout=0.1,
  ):
      if nb_harmonics:
          thetas_dim = nb_harmonics
      else:
          thetas_dim = forecast_length
      self.min_period = min_period
  
      super().__init__(
          units=units,
          thetas_dim=thetas_dim,
          num_block_layers=num_block_layers,
          backcast_length=backcast_length,
          forecast_length=forecast_length,
          share_thetas=True,
          dropout=dropout,
      )
  
      backcast_linspace, forecast_linspace = linspace(
          backcast_length, forecast_length, centered=False
      )
  
      p1, p2 = (
          (thetas_dim // 2, thetas_dim // 2)
          if thetas_dim % 2 == 0
          else (thetas_dim // 2, thetas_dim // 2 + 1)
      )
      s1_b = torch.tensor(
          [
              np.cos(2 * np.pi * i * backcast_linspace)
              for i in self.get_frequencies(p1)
          ],
          dtype=torch.float32,
      )  # H/2-1
      s2_b = torch.tensor(
          [
              np.sin(2 * np.pi * i * backcast_linspace)
              for i in self.get_frequencies(p2)
          ],
          dtype=torch.float32,
      )
      self.register_buffer("S_backcast", torch.cat([s1_b, s2_b]))
  
      s1_f = torch.tensor(
          [
              np.cos(2 * np.pi * i * forecast_linspace)
              for i in self.get_frequencies(p1)
          ],
          dtype=torch.float32,
      )  # H/2-1
      s2_f = torch.tensor(
          [
              np.sin(2 * np.pi * i * forecast_linspace)
              for i in self.get_frequencies(p2)
          ],
          dtype=torch.float32,
      )
      self.register_buffer("S_forecast", torch.cat([s1_f, s2_f]))
  
imports: from typing import Tuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new NBEATSSeasonalBlock object from inherited base classes: NBEATSBlock with example: obj = NBEATSSeasonalBlock(units, thetas_dim, num_block_layers, backcast_length, forecast_length, nb_harmonics, min_period, dropout)