public void TestClone() { var f = new ActivationFunctions.Tanh(2.3); Assert.AreEqual(f, f.Clone()); Assert.AreNotSame(f, f.Clone()); }
public void TestMutate() { var f = new ActivationFunctions.Tanh(1); var r = MockRandom(.2); f.Mutate(r, new FunctionParameters(0, new Parameter(0, 0, .2))); Assert.AreEqual(new ActivationFunctions.Tanh(.88), f); }
public void TestTanhNormal() { var f = new ActivationFunctions.Tanh(1); Assert.AreEqual(Math.Tanh(3), f.GetActivation(3), Delta); }
public void TestTanhScaledReversed() { var f = new ActivationFunctions.Tanh(-.5); Assert.AreEqual(Math.Tanh(-.5 * 7), f.GetActivation(7), Delta); }
public void TestTanhScaled() { var f = new ActivationFunctions.Tanh(3); Assert.AreEqual(Math.Tanh(3 * 5), f.GetActivation(6), Delta); }