  We propose the inverse design of ultracompact, broadband focusing
spectrometers based on adaptive deep diffractive neural networks (a-D$^2$NNs).
Specifically, we introduce and characterize two-layer diffractive devices with
engineered angular dispersion that focus and steer broadband incident radiation
along predefined focal trajectories with desired bandwidth and $5$ nm spectral
resolution. Moreover, we systematically study the focusing efficiency of
two-layer devices with side length $L=100~\mu\mathrm{m}$ and focal length
$f=300~\,\mu\mathrm{m}$ across the visible spectrum and we demonstrate accurate
reconstruction of the emission spectrum from a commercial superluminescent
diode. The proposed a-D$^2$NNs design method extends the capabilities of
efficient multi-focal diffractive optical devices to include single-shot
focusing spectrometers with customized focal trajectories for applications to
ultracompact multispectral imaging and lensless microscopy.
