Beispiel #1
0
        /// <summary>
        /// Calculates the Output for a given Input using the Sigmoid Function.
        /// </summary>
        /// <param name="passedInput">The Input.</param>
        /// <param name="passedThreshold">The Threshold.</param>
        /// <returns>The Output for the Sigmoid Function.</returns>
        public INeuronOutput CalculateOutput(INeuronActivationFunctionInput passedInput, INeuronThreshold passedThreshold)
        {
            float         resultValue = (float)(1 / (1 + Math.Exp((-passedInput.Value) / passedThreshold.Value)));
            INeuronOutput result      = new NeuronOutput(resultValue);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Calculates the Output for a given Input using the Step Function.
        /// </summary>
        /// <param name="passedInput">The Input.</param>
        /// <param name="passedThreshold">The Threshold.</param>
        /// <returns>The Output for the Step Function.</returns>
        public INeuronOutput CalculateOutput(INeuronActivationFunctionInput passedInput, INeuronThreshold passedThreshold)
        {
            float         resultValue = (passedInput.Value >= passedThreshold.Value) ? 1 : 0;
            INeuronOutput result      = new NeuronOutput(resultValue);

            return(result);
        }