def supervised_depth_eigen2014a(outputs, labels):
    """
    Loss for depth estimation in supervised learning
    This loss is described in D. Eigen and al. (2014a)
    Title : Depth Map Prediction from a Single Image using a Multi-Scale Deep Network
    Link : https://arxiv.org/abs/1406.2283

    IMPLEMENTATION:
    ---------------

    :implementer: Alix Leroy
    """
    # Size
    batch_size, channels, height, width = labels.shape

    # Number of element in an image
    n = batch_size * channels * height * width

    # Log distance
    d = outputs.log() - labels.log()

    # L2 related term (Note that a pure L2 would use torch.dist() in order to use the squared-root)
    l2 = d.pow(2).sum().div(n)

    # Scale invariant difference : "that credits mistakes if they are in the same direction and penalizes them if they oppose.
    # Thus, an imperfect prediction will have lower error when its mistake sare consistent with one another" (cf. paper)
    SID = d.sum().pow(2).div(2*(n**2))

    # Final loss
    L_depth = l2 - SID

    return L_depth