import torch


def fMAPE(preds, targs, *kwargs):
    """
    Loss function
    Mean Absolute Percentage Error
    N-BEATS paper definition
    """
    return torch.mean( torch.abs((targs - preds) / targs) )