A reliable characterization of x-ray pulses is critical to optimally exploit advanced photon sources, such as free-electron lasers. The authors present a method based on machine learning which ...