Subspace learning of neural networks