public double[] Feedforward(double[] x) { if (x.Length != InputLayer.Neurons.Count) { throw new DataAndInputLayerSizeMismatchException( "Resize the input layer to match the size of the training data."); } for (int d = 0; d < x.Length; d++) { (InputLayer.Neurons[d]).Activation = x[d]; } foreach (HiddenLayer hiddenLayer in HiddenLayers) { hiddenLayer.ComputeLayerTrainingOutput(); } List <double> output = new List <double>(); output.AddRange(OutputLayer.ComputeLayerTrainingOutput()); return(output.ToArray()); }