public void TanhFunctionReturnsCorrectResult() { Node node = new Node(); node.Input = 10; node.ActivationFunction = new HyperbolicTangentActivationFunction(); node.Activate(null); Assert.AreEqual(Math.Tanh(node.Input), node.ActivatedSum); }
public void SigmoidFunctionReturnsCorrectResult() { Node node = new Node(); node.Input = 10; node.ActivationFunction = new LogisticSigmoidActivationFunction(); node.Activate(null); Assert.AreEqual((1.0 / (1.0 + Math.Exp(-(node.Input)))), node.ActivatedSum); }