Learning perceptual similarity from crowds and machines