public void TestClone() { var f = new ActivationFunctions.Sigmoid(2.3); Assert.AreEqual(f, f.Clone()); Assert.AreNotSame(f, f.Clone()); }
public void TestMutate() { var f = new ActivationFunctions.Sigmoid(1); var r = MockRandom(.7); f.Mutate(r, new FunctionParameters(0, new Parameter(0, 0, .3))); Assert.AreEqual(new ActivationFunctions.Sigmoid(1.12), f); }
public void TestNormal() { var f = new ActivationFunctions.Sigmoid(1); Assert.AreEqual(1 / (1 + Math.Exp(-3)), f.GetActivation(3), Delta); }
public void TestScaledReversed() { var f = new ActivationFunctions.Sigmoid(-5); Assert.AreEqual(1 / (1 + Math.Exp(5 * 6)), f.GetActivation(6), Delta); }
public void TestScaled() { var f = new ActivationFunctions.Sigmoid(7); Assert.AreEqual(1 / (1 + Math.Exp(-7 * 2)), f.GetActivation(2), Delta); }