  We calibrate the distance and reconstruct the Hubble diagram of gamma-ray
bursts (GRBs) using deep learning. We construct an artificial neural network,
which combines the recurrent neural network and Bayesian neural network, and
train the network using the Pantheon compilation of type-Ia supernovae. The
trained network is used to calibrate the distance of 174 GRBs based on the
Combo-relation. We verify that there is no evident redshift evolution of
Combo-relation, and obtain the slope and intercept parameters,
$\gamma=0.856^{+0.083}_{-0.078}$ and $\log A=49.661^{+0.199}_{-0.217}$, with an
intrinsic scatter $\sigma_{\rm int}=0.228^{+0.041}_{-0.040}$. Our calibrating
method is independent of cosmological model, thus the calibrated GRBs can be
directly used to constrain cosmological parameters. It is shown that GRBs alone
can tightly constrain the $\Lambda$CDM model, with $\Omega_{\rm
M}=0.280^{+0.049}_{-0.057}$. However, the constraint on the $\omega$CDM model
is relatively looser, with $\Omega_{\rm M}=0.345^{+0.059}_{-0.060}$ and
$\omega<-1.414$. The combination of GRBs and Pantheon can tightly constrain the
$\omega$CDM model, with $\Omega_{\rm M}=0.336^{+0.055}_{-0.050}$ and
$\omega=-1.141^{+0.156}_{-0.135}$.
