Machine-learning based high-bandwidth magnetic sensing