Implicit bias with Ritz-Galerkin method in understanding deep learning for solving PDEs