docstr: sMAPE loss as defined in https://robjhyndman.com/hyndsight/smape/ (Chen and Yang 2004)
  
  Given a time series of actual values :math:`y_t` and a time series of predicted values :math:`\hat{y}_t`
  both of length :math:`T`, it is computed as
  
  .. math::
      \frac{1}{T}
      \sum_{t=1}^{T}{\frac{\left| y_t - \hat{y}_t \right|}
                            {\left| y_t \right| + \left| \hat{y}_t \right|} }.
  
  The results of divisions yielding NaN or Inf are replaced by 0. Note that we drop the coefficient of
  200 usually used for computing sMAPE values, as it impacts only the magnitude of the gradients
  and not their direction.
  
  Parameters
  ----------
  block_denom_grad
      Whether to stop the gradient in the denominator
docstr_tok: ["sMAPE","loss","as","defined","in","https",":","\/\/robjhyndman.com\/hyndsight\/smape\/","(","Chen","and","Yang","2004",")","Given","a","time","series","of","actual","values",":","math",":","`","y_t","`","and","a","time","series","of","predicted","values",":","math",":","`","\\hat","{","y","}","_t","`","both","of","length",":","math",":","`","T","`",",","it","is","computed","as","..","math",":",":","\\frac","{","1","}","{","T","}","\\sum_","{","t=1","}","^","{","T","}","{","\\frac","{","\\left|","y_t","-","\\hat","{","y","}","_t","\\right|","}","{","\\left|","y_t","\\right|","+","\\left|","\\hat","{","y","}","_t","\\right|","}","}",".","The","results","of","divisions","yielding","NaN","or","Inf","are","replaced","by","0",".","Note","that","we","drop","the","coefficient","of","200","usually","used","for","computing","sMAPE","values",",","as","it","impacts","only","the","magnitude","of","the","gradients","and","not","their","direction",".","Parameters","--","--","--","--","--","block_denom_grad","Whether","to","stop","the","gradient","in","the","denominator"]
code: def __init__(self, block_denom_grad: bool = True):
      """
      sMAPE loss as defined in https://robjhyndman.com/hyndsight/smape/ (Chen and Yang 2004)
  
      Given a time series of actual values :math:`y_t` and a time series of predicted values :math:`\\hat{y}_t`
      both of length :math:`T`, it is computed as
  
      .. math::
          \\frac{1}{T}
          \\sum_{t=1}^{T}{\\frac{\\left| y_t - \\hat{y}_t \\right|}
                                {\\left| y_t \\right| + \\left| \\hat{y}_t \\right|} }.
  
      The results of divisions yielding NaN or Inf are replaced by 0. Note that we drop the coefficient of
      200 usually used for computing sMAPE values, as it impacts only the magnitude of the gradients
      and not their direction.
  
      Parameters
      ----------
      block_denom_grad
          Whether to stop the gradient in the denominator
      """
      super().__init__()
      self.block_denom_grad = block_denom_grad
  
file_path: darts/darts/utils/losses.py
imports: import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new SmapeLoss object from inherited base classes: nn with example: obj = SmapeLoss(block_denom_grad)