  We develop a framework for the analysis of deep neural networks and neural
ODE models that are trained with stochastic gradient algorithms. We do that by
identifying the connections between control theory, deep learning and theory of
statistical sampling. We derive Pontryagin's optimality principle and study the
corresponding gradient flow in the form of Mean-Field Langevin dynamics (MFLD)
for solving relaxed data-driven control problems. Subsequently, we study
uniform-in-time propagation of chaos of time-discretised MFLD. We derive
explicit convergence rate in terms of the learning rate, the number of
particles/model parameters and the number of iterations of the gradient
algorithm. In addition, we study the error arising when using a finite training
data set and thus provide quantitive bounds on the generalisation error.
Crucially, the obtained rates are dimension-independent. This is possible by
exploiting the regularity of the model with respect to the measure over the
parameter space.
