コード例 #1
0
ファイル: Activation.cs プロジェクト: n1arash/Vortex
        public void ReluPrimeTest()
        {
            var a = new Matrix(2, 2);

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

            a = new ReluKernel().Backward(a);
            b.InMap((x) => x > 0 ? 1 : 0);
            Assert.IsTrue(a == b, "ReLU Derivative successful");
        }
コード例 #2
0
ファイル: Activation.cs プロジェクト: n1arash/Vortex
        public void ReluTest()
        {
            var a = new Matrix(2, 2);

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

            a = new ReluKernel().Forward(a);
            b.InMap((x) => Math.Max(x, 0));
            Assert.IsTrue(a == b, "ReLU Activation successful");
        }