Painting galaxies into dark matter haloes using machine learning | Synapse