The information propagation in online social networks is characterized by a nonlinear partial differential equation with the Neumann boundary conditions and initial condition (source) that depends on the type of information and social network. The problem of source identification using additional measurements of the number of influenced users with a discrete distance at fixed times is numerically investigated. One way to solve the source problem for the diffusive-logistic model is to reduce it to the minimization least squares problem that is solved by a combination of the global particle swarm optimization and the local Nelder-Mead methods. Another way is to construct the function of the density of influenced users in space and time that describes additional measurements with high accuracy using a machine learning method named artificial neural networks. The results of numerical calculations for synthetic data show the accuracy of 99% of the source reconstruction. The neural networks approximate additional measurements with lower accuracy, but the approximation function satisfies the diffusive-logistic mathematical model. The novelty lies in the comparative analysis of the stochastic method for minimizing the misfit function based on the structure of the model, and the machine learning approach, which does not use the mathematical model while learning.