示例#1
0
文件: CNNTest.cs 项目: pxqr/nanon
        static double Test(IHypothesis<Matrix, Vector> network, IDataSet<Matrix, Vector> dataSet, double oldcost = Double.PositiveInfinity)
        {
            var rtester = new RegressionTester<Matrix>(network);
            var cost = rtester.Test(dataSet);

            var classifier = new MaxFitClassifier<Matrix>(network);
            var ctester = new ClassifierTester<Matrix, Vector, int>(classifier, x => x.IndexOfMax);
            var accuracy = ctester.Test(dataSet);

            Console.Write("C {0} | {1}%", cost, accuracy * 100);

            if (oldcost < cost)
            {
                Console.WriteLine();
                Console.WriteLine("Warning: probably weights will divergent!");
            }

            return cost;
        }
示例#2
0
 public IHypothesis <object> AssertThat()
 {
     _hypothesis = Hypothesis.For <object>();
     return(_hypothesis);
 }