//TODO refactor - do not use tempsum - but beware of rounding issues public void ForwardPropagation(double[] input, ReadData[] readData) { //Foreach neuron in hidden layer for (int neuronIndex = 0; neuronIndex < _controllerSize; neuronIndex++) { double sum = 0; sum = GetReadDataContributionToHiddenLayer(neuronIndex, readData, sum); sum = GetInputContributionToHiddenLayer(neuronIndex, input, sum); sum = GetThresholdContributionToHiddenLayer(neuronIndex, sum); //Set new controller unit value HiddenLayerNeurons[neuronIndex].Value = _activationFunction.Value(sum); } }