  In this paper, we consider the balancing domain decomposition by constraints
(BDDC) algorithm with adaptive coarse spaces for a class of stochastic elliptic
problems. The key ingredient in the construction of the coarse space is the
solutions of local spectral problems, which depend on the coefficient of the
PDE. This poses a significant challenge for stochastic coefficients as it is
computationally expensive to solve the local spectral problems for every
realisation of the coefficient. To tackle this computational burden, we propose
a machine learning approach. Our method is based on the use of a deep neural
network (DNN) to approximate the relation between the stochastic coefficients
and the coarse spaces. For the input of the DNN, we apply the Karhunen-Lo\`eve
expansion and use the first few dominant terms in the expansion. The output of
the DNN is the resulting coarse space, which is then applied with the standard
adaptive BDDC algorithm. We will present some numerical results with
oscillatory and high contrast coefficients to show the efficiency and
robustness of the proposed scheme.
