Machine learning active-nematic hydrodynamics