Quantum algorithms for optimisation problems in machine learning