  We present the novel wide & deep neural network GalaxyNet, which connects the
properties of galaxies and dark matter haloes, and is directly trained on
observed galaxy statistics using reinforcement learning. The most important
halo properties to predict stellar mass and star formation rate (SFR) are halo
mass, growth rate, and scale factor at the time the mass peaks, which results
from a feature importance analysis with random forests. We train different
models with supervised learning to find the optimal network architecture.
GalaxyNet is then trained with a reinforcement learning approach: for a fixed
set of weights and biases, we compute the galaxy properties for all haloes and
then derive mock statistics (stellar mass functions, cosmic and specific SFRs,
quenched fractions, and clustering). Comparing these statistics to observations
we get the model loss, which is minimised with particle swarm optimisation.
GalaxyNet reproduces the observed data very accurately
($\chi_\mathrm{red}=1.05$), and predicts a stellar-to-halo mass relation with a
lower normalisation and shallower low-mass slope at high redshift than
empirical models. We find that at low mass, the galaxies with the highest SFRs
are satellites, although most satellites are quenched. The normalisation of the
instantaneous conversion efficiency increases with redshift, but stays constant
above $z\gtrsim0.7$. Finally, we use GalaxyNet to populate a cosmic volume of
$(5.9~\mathrm{Gpc})^3$ with galaxies and predict the BAO signal, the bias, and
the clustering of active and passive galaxies up to $z=4$, which can be tested
with next-generation surveys, such as LSST and Euclid.
