Learning to Program Quantum Measurements for Machine Learning