Added output dimension parameter to neural network.