  We present a subspace method based on neural networks for solving the partial
differential equation in weak form with high accuracy. The basic idea of our
method is to use some functions based on neural networks as base functions to
span a subspace, then find an approximate solution in this subspace. Training
base functions and finding an approximate solution can be separated, that is
different methods can be used to train these base functions, and different
methods can also be used to find an approximate solution. In this paper, we
find an approximate solution of the partial differential equation in the weak
form. Our method can achieve high accuracy with low cost of training. Numerical
examples show that the cost of training these base functions is low, and only
one hundred to two thousand epochs are needed for most tests. The error of our
method can fall below the level of $10^{-7}$ for some tests. The proposed
method has the better performance in terms of the accuracy and computational
cost.
