An effective theory of collective deep learning