On the basis of applying deep neural network, this paper proposes a methodology to estimate and optimize the network losses for a designated power grid. This method seeks the internal relationship between the operation state of the reactive power compensation equipments and transformers and the network losses in the system network, with the deep neural network, combining with the improved genetic algorithm, the reactive power compensation equipments and transformer ratio are optimized and solved to realize rapid regulation and control. The method solves the convergence problem when the traditional power flow calculation is used to solving the nonlinear mixed variable programming. In this paper, instead of using power flow distribution data for training, the node voltages data is used to achieve dimension reduction while ensuring global response information in power system. The training effect of deep neural network is optimized with good point set samples, and the traditional genetic algorithms is improved to enhance the global and convergence speed of search. Finally, the proposed scheme is tested on the IEEE30-node system and the effectiveness of the methodology is proved to be effective.