(forecast: t.Tensor, target: t.Tensor, mask: t.Tensor)
return 200 * t.mean(divide_no_nan(t.abs(forecast - target), forecast.data + target.data) * mask)
sMAPE loss as defined in "Appendix A" of
    http://www.forecastingprinciples.com/files/pdf/Makridakia-The%20M3%20Competition.pdf

    :param forecast: Forecast values. Shape: batch, time
    :param target: Target values. Shape: batch, time
    :param mask: 0/1 mask. Shape: batch, time
    :return: Loss value
sMAPE loss as defined in "Appendix A" of
    http://www.forecastingprinciples.com/files/pdf/Makridakia-The%20M3%20Competition.pdf
sMAPE loss as defined in Appendix A of http : // www . forecastingprinciples . com / files / pdf / Makridakia - The%20M3%20Competition . pdf
def smape_1_loss(forecast: t.Tensor, target: t.Tensor, mask: t.Tensor) -> t.float:
    """
    sMAPE loss as defined in "Appendix A" of
    http://www.forecastingprinciples.com/files/pdf/Makridakia-The%20M3%20Competition.pdf

    :param forecast: Forecast values. Shape: batch, time
    :param target: Target values. Shape: batch, time
    :param mask: 0/1 mask. Shape: batch, time
    :return: Loss value
    """
    return 200 * t.mean(divide_no_nan(t.abs(forecast - target), forecast.data + target.data) * mask)
def smape_1_loss ( forecast : t . Tensor , target : t . Tensor , mask : t . Tensor ) -> t . float : return 200 * t . mean ( divide_no_nan ( t . abs ( forecast - target ) , forecast . data + target . data ) * mask )