class_docstr: The WaveNet model.
  
  Parameters
  ----------
  pred_length
      Prediction length.
  bin_values
      List of bin values.
  num_residual_channels
      Number of residual channels.
  num_skip_channels
      Number of skip channels.
  dilation_depth
      The depth of the dilated convolution.
  num_stacks
      The number of dilation stacks.
  num_feat_dynamic_real, optional
      The number of dynamic real features, by default 1
  num_feat_static_real, optional
      The number of static real features, by default 1
  cardinality, optional
      The cardinalities of static categorical features, by default [1]
  embedding_dimension, optional
      The dimension of the embeddings for categorical features, by default 5
  num_parallel_samples, optional
      The number of parallel samples to generate during inference.
      This parameter is only used in inference mode, by default 100
  temperature, optional
      Temparature used for sampling from the output softmax distribution,
      by default 1.0
class_docstr_tok: ["The","WaveNet","model",".","Parameters","--","--","--","--","--","pred_length","Prediction","length",".","bin_values","List","of","bin","values",".","num_residual_channels","Number","of","residual","channels",".","num_skip_channels","Number","of","skip","channels",".","dilation_depth","The","depth","of","the","dilated","convolution",".","num_stacks","The","number","of","dilation","stacks",".","num_feat_dynamic_real",",","optional","The","number","of","dynamic","real","features",",","by","default","1","num_feat_static_real",",","optional","The","number","of","static","real","features",",","by","default","1","cardinality",",","optional","The","cardinalities","of","static","categorical","features",",","by","default","[","1","]","embedding_dimension",",","optional","The","dimension","of","the","embeddings","for","categorical","features",",","by","default","5","num_parallel_samples",",","optional","The","number","of","parallel","samples","to","generate","during","inference",".","This","parameter","is","only","used","in","inference","mode",",","by","default","100","temperature",",","optional","Temparature","used","for","sampling","from","the","output","softmax","distribution",",","by","default","1.0"]
code: def __init__(
      self,
      pred_length: int,
      bin_values: List[float],
      num_residual_channels: int,
      num_skip_channels: int,
      dilation_depth: int,
      num_stacks: int,
      num_feat_dynamic_real: int = 1,
      num_feat_static_real: int = 1,
      cardinality: List[int] = [1],
      embedding_dimension: int = 5,
      num_parallel_samples: int = 100,
      temperature: float = 1.0,
      use_log_scale_feature: bool = True,
  ):
      super().__init__()
  
      self.dilation_depth = dilation_depth
      self.prediction_length = pred_length
      self.num_parallel_samples = num_parallel_samples
      self.temperature = temperature
      self.num_features = (
          embedding_dimension * len(cardinality)
          + num_feat_dynamic_real
          + num_feat_static_real
          + int(use_log_scale_feature)  # the log(scale)
          + 1  # for observed value indicator
      )
      self.use_log_scale_feature = use_log_scale_feature
  
      # 1 extra bin to accounts for extreme values
      self.n_bins = len(bin_values) + 1
      self.dilations = self._get_dilations(dilation_depth, num_stacks)
      self.receptive_field = self.get_receptive_field(
          dilation_depth, num_stacks
      )
      self.trim_lengths = [
          sum(self.dilations) - sum(self.dilations[: i + 1])
          for i, _ in enumerate(self.dilations)
      ]
  
      # Modules
      self.feature_embedder = FeatureEmbedder(
          cardinalities=cardinality,
          embedding_dims=[embedding_dimension] * len(cardinality),
      )
      self.target_embedder = nn.Embedding(
          num_embeddings=self.n_bins,
          embedding_dim=num_residual_channels,
      )
      self.residuals = nn.ModuleList()
      for i, d in enumerate(self.dilations):
          self.residuals.add_module(
              f"residual_layer_{i}",
              CausalDilatedResidualLayer(
                  num_residual_channels=num_residual_channels,
                  num_skip_channels=num_skip_channels,
                  dilation=d,
                  kernel_size=2,
                  return_dense_output=i + 1 < len(self.dilations),
              ),
          )
  
      self.conv_project = nn.Conv1d(
          in_channels=num_residual_channels + self.num_features,
          out_channels=num_residual_channels,
          kernel_size=1,
          bias=True,
      )
      with torch.no_grad():
          assert self.conv_project.bias is not None
          self.conv_project.bias.zero_()
  
      self.conv1 = nn.Conv1d(
          in_channels=num_skip_channels,
          out_channels=num_skip_channels,
          kernel_size=1,
      )
      self.conv2 = nn.Conv1d(
          in_channels=num_skip_channels,
          out_channels=self.n_bins,
          kernel_size=1,
      )
      self.output_act = nn.ELU()
      self.lookup_values = LookupValues(
          torch.tensor(bin_values, dtype=torch.float32)
      )
      self.criterion = nn.CrossEntropyLoss(reduction="none")
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  from gluonts.core.component import validated
  from gluonts.torch.modules.feature import FeatureEmbedder
  from gluonts.torch.modules.lookup_table import LookupValues
label_desc: Use image node_id 1 to create a new WaveNet object from inherited base classes: nn with example: obj = WaveNet(pred_length, bin_values, num_residual_channels, num_skip_channels, dilation_depth, num_stacks, num_feat_dynamic_real, num_feat_static_real, cardinality, embedding_dimension, num_parallel_samples, temperature, use_log_scale_feature)