Machine learning for classifying and interpreting coherent X-ray speckle patterns