Calculates the gradient dR and dL for the current epoch.
localLoss(L, R, is, js, error_matrix)
a list containing two matrices containing the local loss