Clone() public method

Clone the object.
public Clone ( ) : object
return object
        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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }