Exemplo n.º 1
0
        static void Main(string[] args)
        {
            cntkModelToGraphviz();

            return;

            //Iris flower recognition
            //Famous multi class classification datset: https://archive.ics.uci.edu/ml/datasets/iris
            string root = "C:\\sc\\github\\anndotnet\\src\\tool\\";

            var mlConfigFile2 = $"{root}\\anndotnet.tool\\model_mlconfigs\\iris.mlconfig";

            Console.WriteLine(Environment.NewLine);
            Console.WriteLine($"****Iris flower recognition****");
            Console.WriteLine(Environment.NewLine);
            var token2 = new CancellationToken();
            var result = MachineLearning.Run(mlConfigFile2, DeviceDescriptor.UseDefaultDevice(), token2, trainingProgress, null);

            ////evaluate model and export the result of testing
            MachineLearning.EvaluateModel(mlConfigFile2, result.BestModelFile, DeviceDescriptor.UseDefaultDevice());

            //******run all configurations in the solution******

            //for (int i = 0; i < 10; i++)
            //    runAllml_configurations(strLocation1)

            //*****end of program*****
            Console.WriteLine("Press any key to continue!");
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void RunExamples()
        {
            for (int i = 0; i < 10; i++)
            {
                //Iris flower recognition
                //Famous multi class classification datset: https://archive.ics.uci.edu/ml/datasets/iris
                var mlConfigFile2 = "./model_mlconfigs/iris.mlconfig";
                Console.WriteLine(Environment.NewLine);
                Console.Title = $"****Iris flower recognition****";
                Console.WriteLine($"****Iris flower recognition****");
                Console.WriteLine(Environment.NewLine);
                var token2 = new CancellationToken();
                var result = MachineLearning.Run(mlConfigFile2, DeviceDescriptor.UseDefaultDevice(), token2, trainingProgress, null);
                MachineLearning.EvaluateModel(mlConfigFile2, result.BestModelFile, DeviceDescriptor.UseDefaultDevice());

                //Bezier Curve Machine Learning Demonstration
                //dataset taken form Code Project Article:
                //https://www.codeproject.com/Articles/1256883/Bezier-Curve-Machine-Learning-Demonstration
                var mlConfigFile = "./model_mlconfigs/BCML.mlconfig";
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine($"****Bezier Curve Machine Learning Demonstration****");
                Console.WriteLine(Environment.NewLine);
                var token = new CancellationToken();
                MachineLearning.Run(mlConfigFile, DeviceDescriptor.UseDefaultDevice(), token, trainingProgress, null);

                //1. daily sales
                //modified dataset from preidct future sales
                var ds_mlConfigFile = "./model_mlconfigs/daily_sales.mlconfig";
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine($"****Predict Daily Sales for 10 items****");
                Console.WriteLine(Environment.NewLine);
                MachineLearning.Run(ds_mlConfigFile, DeviceDescriptor.UseDefaultDevice(), new CancellationToken(), trainingProgress, null);


                //1. solar production
                //CNTK Tutorial 106B_ https://cntk.ai/pythondocs/CNTK_106B_LSTM_Timeseries_with_IOT_Data.html
                var mlConfigFile11 = "C:\\Users\\bhrnjica\\OneDrive - BHRNJICA\\AI Projects\\ann-custom-models" +
                                     "\\solar_production.mlconfig";
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine($"****Predict Solar production****");
                Console.WriteLine(Environment.NewLine);
                var token11 = new CancellationToken();
                MachineLearning.Run(mlConfigFile11, DeviceDescriptor.UseDefaultDevice(), token11, trainingProgress, null);


                //2. Predict future sales,-  Multiple Input variables
                //Kaggle competition dataset
                var mlConfigFile1 = "C:\\Users\\bhrnjica\\OneDrive - BHRNJICA\\AI Projects\\ann-custom-models" +
                                    "\\predict_future_sales.mlconfig";
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine($"****Predict Future Sales****");
                Console.WriteLine(Environment.NewLine);
                var token1 = new CancellationToken();
                MachineLearning.Run(mlConfigFile1, DeviceDescriptor.UseDefaultDevice(), token1, trainingProgress, CustomNNModels.CustomModelCallEntryPoint);
            }
        }
Exemplo n.º 3
0
        private static void runExample(string title, string mlConfigPath, CreateCustomModel model = null)
        {
            var mlConfigFile2 = mlConfigPath;

            Console.WriteLine(Environment.NewLine);
            Console.WriteLine($"****{title}****");
            Console.WriteLine(Environment.NewLine);
            var token2 = new CancellationToken();

            MachineLearning.Run(mlConfigFile2, DeviceDescriptor.UseDefaultDevice(), token2, trainingProgress, model);
        }