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"]
docstr: Computes the training loss for the wavenet model.
  
  Parameters
  ----------
  feat_static_cat
      Static categorical features: (batch_size, num_cat_features)
  feat_static_real
      Static real-valued features: (batch_size, num_feat_static_real)
  past_target
      Past target: (batch_size, receptive_field)
  past_observed_values
      Observed value indicator for the past target: (batch_size,
      receptive_field)
  past_time_feat
      Past time features: (batch_size, num_time_features,
      receptive_field)
  future_time_feat
      Future time features: (batch_size, num_time_features, pred_length)
  future_target
      Target on which the loss is computed: (batch_size, pred_length)
  future_observed_values
      Observed value indicator for the future target:
      (batch_size, pred_length). This will be set to all ones, if not
      provided (e.g., during inference)
  scale
      Scale of the time series: (batch_size, 1)
  
  Returns
  -------
      Loss tensor with shape (batch_size, pred_length)
docstr_tok: ["Computes","the","training","loss","for","the","wavenet","model",".","Parameters","--","--","--","--","--","feat_static_cat","Static","categorical","features",":","(","batch_size",",","num_cat_features",")","feat_static_real","Static","real-valued","features",":","(","batch_size",",","num_feat_static_real",")","past_target","Past","target",":","(","batch_size",",","receptive_field",")","past_observed_values","Observed","value","indicator","for","the","past","target",":","(","batch_size",",","receptive_field",")","past_time_feat","Past","time","features",":","(","batch_size",",","num_time_features",",","receptive_field",")","future_time_feat","Future","time","features",":","(","batch_size",",","num_time_features",",","pred_length",")","future_target","Target","on","which","the","loss","is","computed",":","(","batch_size",",","pred_length",")","future_observed_values","Observed","value","indicator","for","the","future","target",":","(","batch_size",",","pred_length",")",".","This","will","be","set","to","all","ones",",","if","not","provided","(","e.g.",",","during","inference",")","scale","Scale","of","the","time","series",":","(","batch_size",",","1",")","Returns","--","--","--","-","Loss","tensor","with","shape","(","batch_size",",","pred_length",")"]
code: def loss(
      self,
      feat_static_cat: torch.Tensor,
      feat_static_real: torch.Tensor,
      past_target: torch.Tensor,
      past_observed_values: torch.Tensor,
      past_time_feat: torch.Tensor,
      future_time_feat: torch.Tensor,
      future_target: torch.Tensor,
      future_observed_values: torch.Tensor,
      scale: torch.Tensor,
  ) -> torch.Tensor:
      """Computes the training loss for the wavenet model.
  
      Parameters
      ----------
      feat_static_cat
          Static categorical features: (batch_size, num_cat_features)
      feat_static_real
          Static real-valued features: (batch_size, num_feat_static_real)
      past_target
          Past target: (batch_size, receptive_field)
      past_observed_values
          Observed value indicator for the past target: (batch_size,
          receptive_field)
      past_time_feat
          Past time features: (batch_size, num_time_features,
          receptive_field)
      future_time_feat
          Future time features: (batch_size, num_time_features, pred_length)
      future_target
          Target on which the loss is computed: (batch_size, pred_length)
      future_observed_values
          Observed value indicator for the future target:
          (batch_size, pred_length). This will be set to all ones, if not
          provided (e.g., during inference)
      scale
          Scale of the time series: (batch_size, 1)
  
      Returns
      -------
          Loss tensor with shape (batch_size, pred_length)
      """
      full_target = torch.cat(
          [past_target, future_target], dim=-1
      ).long()
      full_features = self.get_full_features(
          feat_static_cat=feat_static_cat,
          feat_static_real=feat_static_real,
          past_observed_values=past_observed_values,
          past_time_feat=past_time_feat,
          future_time_feat=future_time_feat,
          future_observed_values=future_observed_values,
          scale=scale,
      )
      input_embedding = self.target_feature_embedding(
          target=full_target[..., :-1], features=full_features[..., 1:]
      )
      logits, _ = self.base_net(input_embedding)
      labels = full_target[..., self.receptive_field :]
      loss_weight = torch.cat(
          [past_observed_values, future_observed_values], dim=-1
      )[..., self.receptive_field :]
  
      assert labels.size() == loss_weight.size()
      loss = self.criterion(
          logits.reshape(-1, self.n_bins), labels.reshape(-1)
      ) * loss_weight.reshape(-1)
      loss = loss.view_as(labels)
      return loss
  
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 7 for calling the WaveNet obj's underlying member method code with example usage: obj.loss(feat_static_cat, feat_static_real, past_target, past_observed_values, past_time_feat, future_time_feat, future_target, future_observed_values, scale) and returns: loss