The spatial layout and optimization of social facilities for sports are related to many factors such as urban economy, transportation, population, and urban planning. With the rapid development of artificial intelligence today, deep learning came into being. It also provides a lot of methods for our in-depth research on it. To solve the problem of unbalanced layout of urban social facilities for sports and the difficulty in meeting the needs of residents under the current background, this paper adopts the methods of M-P model, loss function, and activation function. Taking Hangzhou, a sports city that is about to host the Asian Games, as an example, it carried out an experiment to optimize the layout of urban public sports services. Through various tests and data, it divides the accessibility level of social facilities for sports in Hangzhou into four levels: high accessibility point (1.0-1.5), high accessibility point (0.5-1.0), the accessibility is average (0.2-0.5), and the accessibility is poor (<0.2). It also concluded that the areas with high accessibility (1.0-1.5) are Shangcheng District and Binjiang District, and the layout of sports facilities is optimal. According to the minimum facility point model, Xiaoshan District and Yuhang District need to add 6 large-scale social facilities for sports. Through this experiment, this paper can also provide a reference for other urban layouts. This has significance for the optimization of sports facilities and the optimization of public facilities.