Understanding Community Structure in Layered Neural Networks