Machine Learning in Pure Mathematics and Theoretical Physics