Generalized deep neural network to n layers.