embedding the classifier into the likelihood