updated merging algorithms to not divide by batch size unless regularization is specified