Building the neural network structure