コード例 #1
0
ファイル: Activation.cs プロジェクト: n1arash/Vortex
        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");
        }
コード例 #2
0
ファイル: Activation.cs プロジェクト: n1arash/Vortex
        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");
        }