Machine learning inversion from scattering for mechanically driven polymers