A quantum trick with photons gives machine learning a speed boost