  Electromagnetic environments are becoming increasingly complex and congested,
creating a growing challenge for systems that rely on electromagnetic waves for
communication, sensing, or imaging, particularly in reverberating environments.
The use of programmable metasurfaces provides a potential means of directing
waves to optimize wireless channels on-demand, ensuring reliable operation and
protecting sensitive electronic components. Here we introduce a technique that
combines a deep learning network with a binary programmable metasurface to
shape waves in complex reverberant electromagnetic environments, in particular
ones where there is no direct line of sight. We applied this technique for
wavefront reconstruction and control, and accurately determined metasurface
configurations based on measured system scattering responses in a chaotic
microwave cavity. The state of the metasurface that realizes desired
electromagnetic wave field distribution properties was successfully determined
even in cases previously unseen by the deep learning algorithm. Our technique
is enabled by the reverberant nature of the cavity, and is effective with a
metasurface that covers only $\sim$1.5\% of the total cavity surface area.
