  Accurate models of radiative cooling are a fundamental ingredient of modern
cosmological simulations. Without cooling, accreted baryons will not
efficiently dissipate their energy and collapse to the centres of haloes to
form stars. It is well established that local variations in the amplitude and
shape of the spectral energy distribution of the radiation field can
drastically alter the cooling rate. Here we introduce deepCool, deepHeat, and
deepMetal: methods for accurately modelling the total cooling rates, total
heating rates, and metal-line only cooling rates of irradiated gas using
artificial neural networks. We train our algorithm on a high-resolution
cosmological radiation hydrodynamics simulation and demonstrate that we can
predict the cooling rate, as measured with the photoionisation code CLOUDY,
under the influence of a local radiation field, to an accuracy of ~5%. Our
method is computationally and memory efficient, making it suitable for
deployment in state-of-the-art radiation hydrodynamics simulations. We show
that the circumgalactic medium and diffuse gas surrounding the central regions
of a galaxy are most affected by the interplay of radiation and gas, and that
standard cooling functions that ignore the local radiation field can
incorrectly predict the cooling rate by more than an order of magnitude,
indicating that the baryon cycle in galaxies is affected by the influence of a
local radiation field on the cooling rate.
