Ejemplo n.º 1
0
        public void Softmax_Create_Test()
        {
            var output = NormalizationHelper.CreateSoftmaxNormalization(givenInput);

            Assert.IsTrue(!object.ReferenceEquals(output, givenInput));
            double sum = 0;

            for (int i = 0; i < givenInput.Count; i++)
            {
                double diff = Math.Abs(expectedOutput[i] - output[i]);
                Assert.IsTrue(diff < Math.Pow(10, -6));
                sum += output[i];
            }
            Assert.IsTrue(StatisticsHelper.IsApproximatelyEqual(sum, 1D));
        }