Encog.Neural.Networks.Synapse.WeightedSynapse.Compute C# (CSharp) Method

Compute() public method

Compute the weighted output from this synapse. Each neuron in the from layer has a weighted connection to each of the neurons in the next layer.
public Compute ( INeuralData input ) : INeuralData
input INeuralData The input from the synapse.
return INeuralData
        public override INeuralData Compute(INeuralData input)
        {
            	INeuralData result = new BasicNeuralData(this.ToNeuronCount);
		
		double[] inputArray = input.Data;
		double[][] matrixArray = this.WeightMatrix.Data;
		double[] resultArray = result.Data;

		for (int i = 0; i < this.ToNeuronCount; i++) {
			
			double sum = 0;
			for(int j = 0;j<inputArray.Length;j++ )
			{
				sum+=inputArray[j]*matrixArray[j][i];
			}
			resultArray[i] = sum;
		}
		return result;
        }