ActivationFunction() публичный Метод

public ActivationFunction ( double x, int start, int size ) : void
x double
start int
size int
Результат void
        public void TestGaussian()
        {
            var activation = new ActivationGaussian();
            Assert.IsTrue(activation.HasDerivative);

            var clone = (ActivationGaussian) activation.Clone();
            Assert.IsNotNull(clone);

            double[] input = {0.0};

            activation.ActivationFunction(input, 0, 1);

            Assert.AreEqual(1.0, input[0], 0.1);
        }
Пример #2
0
        public void TestGaussian()
        {
            var activation = new ActivationGaussian();

            Assert.IsTrue(activation.HasDerivative);

            var clone = (ActivationGaussian)activation.Clone();

            Assert.IsNotNull(clone);

            double[] input = { 0.0 };

            activation.ActivationFunction(input, 0, 1);

            Assert.AreEqual(1.0, input[0], 0.1);
        }
Пример #3
0
        public void TestGaussian()
        {
            var activation = new ActivationGaussian();

            Assert.IsTrue(activation.HasDerivative);

            var clone = activation.Clone();

            Assert.IsInstanceOfType(clone, typeof(ActivationGaussian));

            double[] input = { 0.0 };

            activation.ActivationFunction(input, 0, 1);

            Assert.AreEqual(1.0, input[0], 0.1);
        }
        public void TestGaussian()
        {
            var activation = new ActivationGaussian(0.0, 0.5, 1.0);
            Assert.IsTrue(activation.HasDerivative());

            var clone = (ActivationGaussian) activation.Clone();
            Assert.IsNotNull(clone);

            double[] input = {0.0};

            activation.ActivationFunction(input, 0, 1);

            Assert.AreEqual(0.5, input[0], 0.1);

            // test derivative, should throw an error

            input[0] = activation.DerivativeFunction(input[0],input[0]);
            Assert.AreEqual(-33, (int) (input[0]*100), 0.1);
        }
Пример #5
0
        public void TestGaussian()
        {
            var activation = new ActivationGaussian(0.0, 0.5, 1.0);

            Assert.IsTrue(activation.HasDerivative());

            var clone = (ActivationGaussian)activation.Clone();

            Assert.IsNotNull(clone);

            double[] input = { 0.0 };

            activation.ActivationFunction(input, 0, 1);

            Assert.AreEqual(0.5, input[0], 0.1);


            // test derivative, should throw an error

            input[0] = activation.DerivativeFunction(input[0], input[0]);
            Assert.AreEqual(-33, (int)(input[0] * 100), 0.1);
        }