Neural Modelling of Astrophysical Gas