Machine Learning Nonlocal Correlations