(forecast: Forecast, insample: np.ndarray, outsample: Target, frequency: int)
return np.mean(np.abs(forecast - outsample)) / np.mean(np.abs(insample[:-frequency] - insample[frequency:]))
MASE loss as defined in "Scaled Errors" https://robjhyndman.com/papers/mase.pdf

    :param forecast: Forecast values. Shape: batch, time_o
    :param insample: Insample values. Shape: batch, time_i
    :param outsample: Target values. Shape: batch, time_o
    :param frequency: Frequency value
    :return: Same shape array with error calculated for each time step
MASE loss as defined in "Scaled Errors" https://robjhyndman.com/papers/mase.pdf
MASE loss as defined in Scaled Errors https : // robjhyndman . com / papers / mase . pdf
def mase(forecast: Forecast, insample: np.ndarray, outsample: Target, frequency: int) -> np.ndarray:
    """
    MASE loss as defined in "Scaled Errors" https://robjhyndman.com/papers/mase.pdf

    :param forecast: Forecast values. Shape: batch, time_o
    :param insample: Insample values. Shape: batch, time_i
    :param outsample: Target values. Shape: batch, time_o
    :param frequency: Frequency value
    :return: Same shape array with error calculated for each time step
    """
    return np.mean(np.abs(forecast - outsample)) / np.mean(np.abs(insample[:-frequency] - insample[frequency:]))
def mase ( forecast : Forecast , insample : np . ndarray , outsample : Target , frequency : int ) -> np . ndarray : return np . mean ( np . abs ( forecast - outsample ) ) / np . mean ( np . abs ( insample [ : - frequency ] - insample [ frequency : ] ) )