compute absolute losses on the fly