Ejemplo n.º 1
0
        /// <summary>
        /// A activation function for a neural network.
        /// </summary>
        /// <param name="d">The input to the function.</param>
        /// <returns>The ouput from the function.</returns>
        public double ActivationFunction(double input)
        {
            //return (BoundNumbers.Exp(input * 2.0) - 1) / (BoundNumbers.Exp(input * 2.0 + 1));

            //Correction suggested by https://github.com/felipetavares
            return((BoundNumbers.Exp(input) - BoundNumbers.Exp(-input)) / (BoundNumbers.Exp(input) + BoundNumbers.Exp(-input)));
        }
Ejemplo n.º 2
0
 public override double Activate(double input)
 {
     return(1.0 / (1 + BoundNumbers.Exp(-1.0 * input)));
 }
 /// <summary>
 /// A activation function for a neural network.
 /// </summary>
 /// <param name="d">The input to the function.</param>
 /// <returns>The ouput from the function.</returns>
 public double ActivationFunction(double d)
 {
     return(1.0 / (1 + BoundNumbers.Exp(-1.0 * d)));
 }
Ejemplo n.º 4
0
 public override double Activate(double input)
 {
     return((BoundNumbers.Exp(input * 2.0) - 1.0) / (BoundNumbers.Exp(input * 2.0) + 1.0));
 }
        /// <summary>
        /// A activation function for a neural network.
        /// </summary>
        /// <param name="d">The input to the function.</param>
        /// <returns>The ouput from the function.</returns>
        public double ActivationFunction(double d)
        {
            double result = (BoundNumbers.Exp(d * 2.0) - 1.0) / (BoundNumbers.Exp(d * 2.0) + 1.0);

            return(result);
        }