Machine learning for beam dynamics studies at the CERN Large Hadron Collider