/// <summary> /// Calculates the Output for the Neuron given the Input. /// </summary> /// <param name="passedInput">The Input for the Neuron.</param> /// <returns>The Output of the Neuron.</returns> public INeuronOutput CalculateOutput(INeuronInputs passedInputs) { float total = 0.0f; IEnumerator <INeuronWeight> neuronWeightsEnumerator = this.Weights.Weights; IEnumerator <INeuronInput> neuronInputsEnumerator = passedInputs.Values; while (neuronWeightsEnumerator.MoveNext() && neuronInputsEnumerator.MoveNext()) { INeuronWeight currentWeight = neuronWeightsEnumerator.Current; INeuronInput currentInput = neuronInputsEnumerator.Current; float tempValue = currentWeight.Value * currentInput.Value; total += tempValue; } float computedResult = this.ActivationFunction.CalculateOutput(total, this.Threshold); INeuronOutput result = new NeuronOutput(computedResult); return(result); }
public Dendrite(INeuronSignal <double> input, INeuronWeight <double> weight) : base(input, weight) { }
protected AbstractDendrite(INeuronSignal <TNeuronDataType> output, INeuronWeight <TNeuronDataType> weight) { this.Output = output; this.DendriteWeight = weight; }