class_docstr: N-BEATS block which takes a basis function as an argument.
class_docstr_tok: ["N-BEATS","block","which","takes","a","basis","function","as","an","argument","."]
code: def __init__(
      self,
      input_size: int,
      h: int,
      futr_input_size: int,
      hist_input_size: int,
      stat_input_size: int,
      n_theta: int,
      mlp_units: list,
      basis: nn.Module,
      dropout_prob: float,
      activation: str,
  ):
      """ """
      super().__init__()
  
      self.dropout_prob = dropout_prob
      self.futr_input_size = futr_input_size
      self.hist_input_size = hist_input_size
      self.stat_input_size = stat_input_size
  
      assert (
          activation in ACTIVATIONS
      ), f"{activation} is not in {ACTIVATIONS}"
      activ = getattr(nn, activation)()
  
      # Input vector for the block is
      # y_lags (input_size) + historical exogenous (hist_input_size*input_size) +
      # future exogenous (futr_input_size*input_size) + static exogenous (stat_input_size)
      # [ Y_[t-L:t], X_[t-L:t], F_[t-L:t+H], S ]
      input_size = (
          input_size
          + hist_input_size * input_size
          + futr_input_size * (input_size + h)
          + stat_input_size
      )
  
      hidden_layers = [
          nn.Linear(
              in_features=input_size, out_features=mlp_units[0][0]
          )
      ]
      for layer in mlp_units:
          hidden_layers.append(
              nn.Linear(in_features=layer[0], out_features=layer[1])
          )
          hidden_layers.append(activ)
  
          if self.dropout_prob > 0:
              hidden_layers.append(nn.Dropout(p=self.dropout_prob))
  
      output_layer = [
          nn.Linear(in_features=mlp_units[-1][1], out_features=n_theta)
      ]
      layers = hidden_layers + output_layer
      self.layers = nn.Sequential(*layers)
      self.basis = basis
  
imports: from typing import Tuple, Optional
  import numpy
  import torch
  import torch.nn
  from ..losses.pytorch import MAE
  from ..common._base_windows import BaseWindows
label_desc: Use image node_id 1 to create a new NBEATSBlock object from inherited base classes: nn with example: obj = NBEATSBlock(input_size, h, futr_input_size, hist_input_size, stat_input_size, n_theta, mlp_units, basis, dropout_prob, activation)