How Machines Learn to Discriminate