public ActivationFunction ( double x, int start, int size ) : void | ||
x | double | |
start | int | |
size | int | |
Résultat | void |
public void TestTANH() { var activation = new ActivationTANH(); Assert.IsTrue(activation.HasDerivative); var clone = (ActivationTANH) activation.Clone(); Assert.IsNotNull(clone); double[] input = {0.0}; activation.ActivationFunction(input, 0, 1); Assert.AreEqual(0.0, input[0], 0.1); // test derivative, should throw an error input[0] = activation.DerivativeFunction(input[0],input[0]); Assert.AreEqual(1.0, input[0], 0.1); }
public void TestTANH() { var activation = new ActivationTANH(); Assert.IsTrue(activation.HasDerivative); var clone = activation.Clone(); Assert.IsInstanceOfType(clone, typeof(ActivationTANH)); double[] input = { 0.0 }; activation.ActivationFunction(input, 0, 1); Assert.AreEqual(0.0, input[0], 0.1); input[0] = activation.DerivativeFunction(input[0], input[0]); Assert.AreEqual(1.0, input[0], 0.1); }
public void TestTANH() { var activation = new ActivationTANH(); Assert.IsTrue(activation.HasDerivative); var clone = (ActivationTANH)activation.Clone(); Assert.IsNotNull(clone); double[] input = { 0.0 }; activation.ActivationFunction(input, 0, 1); Assert.AreEqual(0.0, input[0], 0.1); // test derivative, should throw an error input[0] = activation.DerivativeFunction(input[0], input[0]); Assert.AreEqual(1.0, input[0], 0.1); }