Esempio n. 1
0
 /// <summary>
 /// Applies some normal noise to soft sign.
 /// </summary>
 /// <param name="x"></param>
 /// <returns></returns>
 public static double NoisySoftSign(double x)
 {
     if (x < 0)
     {
         return((2 * (Math.Exp(x) / (1 + Math.Exp(x))) - 1) + StaticRandom.Normal(0, 0.2));
     }
     else
     {
         return((2 / (1 + Math.Exp(-x)) - 1) + StaticRandom.Normal(0, 0.2));
     }
 }