docstr: MAPE loss as defined in: https://en.wikipedia.org/wiki/Mean_absolute_percentage_error.
  
  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|}{y_t}}.
  
  The results of divisions yielding NaN or Inf are replaced by 0. Note that we drop the coefficient of
  100 usually used for computing MAPE values, as it impacts only the magnitude of the gradients
  and not their direction.
docstr_tok: ["MAPE","loss","as","defined","in",":","https",":","\/\/en.wikipedia.org\/wiki\/Mean_absolute_percentage_error",".","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|","}","{","y_t","}","}",".","The","results","of","divisions","yielding","NaN","or","Inf","are","replaced","by","0",".","Note","that","we","drop","the","coefficient","of","100","usually","used","for","computing","MAPE","values",",","as","it","impacts","only","the","magnitude","of","the","gradients","and","not","their","direction","."]
code: def __init__(self):
      """
      MAPE loss as defined in: https://en.wikipedia.org/wiki/Mean_absolute_percentage_error.
  
      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|}{y_t}}.
  
      The results of divisions yielding NaN or Inf are replaced by 0. Note that we drop the coefficient of
      100 usually used for computing MAPE values, as it impacts only the magnitude of the gradients
      and not their direction.
      """
      super().__init__()
  
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 MapeLoss object from inherited base classes: nn with example: obj = MapeLoss()