Exemplo n.º 1
0
 public static void RegressionTest(Network network, DataSet.DataSet data)
 {
     foreach (var datum in data.TestData())
     {
         WriteLine($"Case : {string.Join(' ', datum.Input)}");
         network.SetInputs(datum.Input);
         network.ForwardPropagation();
         WriteLine($"Output : {string.Join(' ', network.Output)}");
     }
 }
Exemplo n.º 2
0
        public static void ClusteringTest(Network network, DataSet.DataSet data)
        {
            var correct = 0.0f;
            var count   = 0.0f;

            WriteLine("Testing.");
            Write($"Success Rate : {0.0f:##0.00%}");
            foreach (var datum in data.TestData())
            {
                count += 1.0f;
                network.SetInputs(datum.Input);
                network.ForwardPropagation();
                var maxIdx = Blas1.iamax(network.Output.Length, network.Output, 1);
                if (maxIdx == Blas1.iamax(datum.Output.Length, datum.Output, 1))
                {
                    correct += 1.0f;
                }
                Write($"\rSuccess Rate : {correct / count:##0.00%}");
            }
            WriteLine();
        }