As matter accretes onto the central supermassive black holes in active galactic nuclei (AGNs), X-rays are emitted. We present a population synthesis model that accounts for the summed X-ray emission from growing black holes; modulo the efficiency of converting mass to X-rays, this is effectively a record of the accreted mass. We need this population synthesis model to reproduce observed constraints from X-ray surveys: the X-ray number counts, the observed fraction of Compton-thick AGNs [log (N_H/cm-2) > 24], and the spectrum of the cosmic X-ray background (CXB), after accounting for selection biases. Over the past decade, X-ray surveys by XMM-Newton, Chandra, NuSTAR, and Swift-BAT have provided greatly improved observational constraints. We find that no existing X-ray luminosity function (XLF) consistently reproduces all these observations. We take the uncertainty in AGN spectra into account and use a neural network to compute an XLF that fits all observed constraints, including observed Compton-thick number counts and fractions. This new population synthesis model suggests that, intrinsically, 50% ± 9% (56% ± 7%) of all AGNs within z ≃ 0.1 (1.0) are Compton-thick.