Ejemplo n.º 1
0
        public void BipolarSigmoidPrimeTest()
        {
            var a = new Matrix(2, 2);

            a.InRandomize();
            var b = a.Duplicate();

            a = new BipolarSigmoidKernel().Backward(a);
            b.InMap((x) => 0.5 * (1 + (-1 + 2 / (1 + Math.Exp(-x)))) * (1 - (-1 + 2 / (1 + Math.Exp(-x)))));
            Assert.IsTrue(a == b, "Bipolar Sigmoid Derivative successful");
        }
Ejemplo n.º 2
0
        public void BipolarSigmoidTest()
        {
            var a = new Matrix(2, 2);

            a.InRandomize();
            var b = a.Duplicate();

            a = new BipolarSigmoidKernel().Forward(a);
            b.InMap((x) => - 1 + 2 / (1 + Math.Exp(-x)));
            Assert.IsTrue(a == b, "Bipolar Sigmoid Activation successful");
        }