Clone() public method

Clone the object.
public Clone ( ) : object
return object
        public void TestActivation()
        {
            var activation = new ActivationBiPolar();
            Assert.IsTrue(activation.HasDerivative);

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

            double[] input = { 0.5, -0.5 };

            activation.ActivationFunction(input, 0, input.Length);

            Assert.AreEqual(1.0, input[0], 0.1);
            Assert.AreEqual(-1.0, input[1], 0.1);
        }
Ejemplo n.º 2
0
        public void TestBiPolar()
        {
            var activation = new ActivationBiPolar();

            Assert.IsTrue(activation.HasDerivative);

            var clone = activation.Clone();

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

            double[] input = { 0.1, -0.1 };

            activation.ActivationFunction(input, 0, input.Length);

            Assert.AreEqual(1.0, input[0], 0.1);
            Assert.AreEqual(-1.0, input[1], 0.1);
        }
Ejemplo n.º 3
0
        public void TestActivation()
        {
            var activation = new ActivationBiPolar();

            Assert.IsTrue(activation.HasDerivative);

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

            Assert.IsNotNull(clone);

            double[] input = { 0.5, -0.5 };

            activation.ActivationFunction(input, 0, input.Length);

            Assert.AreEqual(1.0, input[0], 0.1);
            Assert.AreEqual(-1.0, input[1], 0.1);
        }