The nonlinear Lane-Emden type equation can be used to describe many physical phenomena. To solve this type of equation, a method based on deep neural network is proposed. The output layer of this network has two layers, the last one of which scaling the outputs of their neighbors with an aim at coping with issues where the values of function to be approximated are much less or larger than the order of 1. The Lane-Emden equation and its initial conditions are employed to construct the loss function, and the problem of solving Lane-Emden equation is transformed into an optimization problem. A hybrid method combined Adam and L-BFGS-B methods is used to solve the optimization problem and consequently the Lane-Emden type equation is solved. To increase the accuracy, an adaptive strategy is incorporated into the training data sampling method. Especially, a strategy in coping with the issue about solving white-dwarf problem is proposed. Numerical experiments are conducted in which reference solutions including analytical solutions and numerical solutions given by Runge-Kutta method are used to verify the effectiveness of our proposed method. More importantly, the solutions over large domains are calculated by the use of the proposed method. The results show that the results given by our method are in good agreement with the reference solutions, and in cases where existent neural-network-based method fails, our method is able to produce convincible results.