Quantum machine learning with adaptive linear optics