NeuralNetwork constructor