  During a solar flare, it is believed that reconnection takes place in the
corona followed by fast energy transport to the chromosphere. The resulting
intense heating strongly disturbs the chromospheric structure, and induces
complex radiation hydrodynamic effects. Interpreting the physics of the flaring
solar atmosphere is one of the most challenging tasks in solar physics. Here we
present a novel deep learning approach, an invertible neural network, to
understanding the chromospheric physics of a flaring solar atmosphere via the
inversion of observed solar line profiles in H{\alpha} and Ca II {\lambda}8542.
Our network is trained using flare simulations from the 1D radiation
hydrodynamics code RADYN as the expected atmosphere and line profile. This
model is then applied to single pixels from an observation of an M1.1 solar
flare taken with SST/CRISP instrument just after the flare onset. The inverted
atmospheres obtained from observations provide physical information on the
electron number density, temperature and bulk velocity flow of the plasma
throughout the solar atmosphere ranging from 0-10 Mm in height. The density and
temperature profiles appear consistent with the expected atmospheric response,
and the bulk plasma velocity provides the gradients needed to produce the broad
spectral lines whilst also predicting the expected chromospheric evaporation
from flare heating. We conclude that we have taught our novel algorithm the
physics of a solar flare according to RADYN and that this can be confidently
used for the analysis of flare data taken in these two wavelengths. This
algorithm can also be adapted for a menagerie of inverse problems providing
extremely fast ($\sim$10 {\mu}s) inversion samples.
