class_docstr: The NBEATS Network as described in the paper:
  https://arxiv.org/abs/1905.10437. This does not constitute the whole NBEATS
  model, which is en ensemble model comprised of a multitude of NBEATS
  Networks.
  
  Parameters
  ----------
  prediction_length
      Length of the prediction. Also known as 'horizon'.
  context_length
      Number of time units that condition the predictions
      Also known as 'lookback period'.
  num_stacks
      The number of stacks the network should contain.
      Default and recommended value for generic mode: 30
      Recommended value for interpretable mode: 2
  num_blocks
      The number of blocks per stack.
      A list of ints of length 1 or 'num_stacks'.
      Default and recommended value for generic mode: [1]
      Recommended value for interpretable mode: [3]
  num_block_layers
      Number of fully connected layers with ReLu activation per block.
      A list of ints of length 1 or 'num_stacks'.
      Default and recommended value for generic mode: [4]
      Recommended value for interpretable mode: [4]
  widths
      Widths of the fully connected layers with ReLu activation in the
      blocks. A list of ints of length 1 or 'num_stacks'.
      Default and recommended value for generic mode: [512]
      Recommended value for interpretable mode: [256, 2048]
  sharing
      Whether the weights are shared with the other blocks per stack.
      A list of ints of length 1 or 'num_stacks'.
      Default and recommended value for generic mode: [False]
      Recommended value for interpretable mode: [True]
  expansion_coefficient_lengths
      If the type is "G" (generic), then the length of the expansion
      coefficient. If type is "T" (trend), then it corresponds to the degree
      of the polynomial. If the type is "S" (seasonal) then its not used.
      A list of ints of length 1 or 'num_stacks'.
      Default value for generic mode: [32]
      Recommended value for interpretable mode: [3]
  stack_types
      One of the following values: "G" (generic), "S" (seasonal) or "T"
      (trend). A list of strings of length 1 or 'num_stacks'.
      Default and recommended value for generic mode: ["G"]
      Recommended value for interpretable mode: ["T","S"]
  scale
      if True scales the input observations by the mean
  kwargs
      Arguments passed to 'HybridBlock'.
docstr: .. math::
  
      smape = (200/H)*mean(|Y - Y_hat| / (|Y| + |Y_hat|))
  
  According to paper: https://arxiv.org/abs/1905.10437.
docstr_tok: ["..","math",":",":","smape","=","(","200\/H",")","*","mean","(","|Y","-","Y_hat|","\/","(","|Y|","+","|Y_hat|",")",")","According","to","paper",":","https",":","\/\/arxiv.org\/abs\/1905.10437","."]
code: def smape_loss(
      self,
      F,
      forecast: Tensor,
      future_target: Tensor,
      future_observed_values: Tensor,
  ) -> Tensor:
      r"""
      .. math::
  
          smape = (200/H)*mean(|Y - Y_hat| / (|Y| + |Y_hat|))
  
      According to paper: https://arxiv.org/abs/1905.10437.
      """
  
      # Stop gradient required for stable learning
      denominator = F.stop_gradient(
          F.abs(future_target) + F.abs(forecast)
      )
      flag = denominator == 0
  
      absolute_error = (
          F.abs(future_target - forecast) * future_observed_values
      )
  
      smape = (200 / self.prediction_length) * F.mean(
          (absolute_error * (1 - flag)) / (denominator + flag),
          axis=1,
      )
  
      return smape
  
imports: from typing import List, Optional
  import mxnet
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
  from gluonts.mx.block.scaler import MeanScaler, NOPScaler
  from gluonts.time_feature import get_seasonality
label_desc: Use image node_id 3 for calling the NBEATSNetwork obj's underlying member method code with example usage: obj.smape_loss(F, forecast, future_target, future_observed_values) and returns: smape