  Neural-network decoders can achieve a lower logical error rate compared to
conventional decoders, like minimum-weight perfect matching, when decoding the
surface code. Furthermore, these decoders require no prior information about
the physical error rates, making them highly adaptable. In this study, we
investigate the performance of such a decoder using both simulated and
experimental data obtained from a transmon-qubit processor, focusing on
small-distance surface codes. We first show that the neural network typically
outperforms the matching decoder due to better handling errors leading to
multiple correlated syndrome defects, such as $Y$ errors. When applied to the
experimental data of [Google Quantum AI, Nature 614, 676 (2023)], the neural
network decoder achieves logical error rates approximately $25\%$ lower than
minimum-weight perfect matching, approaching the performance of a
maximum-likelihood decoder. To demonstrate the flexibility of this decoder, we
incorporate the soft information available in the analog readout of transmon
qubits and evaluate the performance of this decoder in simulation using a
symmetric Gaussian-noise model. Considering the soft information leads to an
approximately $10\%$ lower logical error rate, depending on the probability of
a measurement error. The good logical performance, flexibility, and
computational efficiency make neural network decoders well-suited for near-term
demonstrations of quantum memories.
