fix discriminative training