more efficient calculation of n in gdmtrain
only need to check for convergence when eval loss