Exemple #1
0
        /// <summary>
        /// Pop up a window for running examples, when compiled with .NET 4.6.1 or higher, then exit the application.  Otherwise do nothing.
        /// </summary>
        public static void RunBrowser() // Must not be called "Run"
        {
#if NETFULL
            InferenceEngine.Visualizer = new Compiler.Visualizers.WindowsVisualizer();
            // Show all tutorials, in a browser
            IAlgorithm[] algs = InferenceEngine.GetBuiltInAlgorithms();

            // Avoid max product in the examples browser, as none of the examples apply.
            List <IAlgorithm> algList = new List <IAlgorithm>(algs);
            algList.RemoveAll(alg => alg is MaxProductBeliefPropagation);
            ExamplesViewer tview = new ExamplesViewer(typeof(ExamplesBrowser), algList.ToArray());
            tview.RunBrowser();
            Environment.Exit(0);
#endif
        }
Exemple #2
0
        public static void Main()
        {
            Type tutorialClass = null;

            //********** UNCOMMENT AND EDIT THIS LINE TO RUN A PARTICULAR TUTORIAL DIRECTLY *************
            //tutorialClass = typeof(MicrosoftResearch.Infer.Tutorials.FirstExample);

            if (tutorialClass != null)
            {
                // Run the specified tutorial
                RunTutorial(tutorialClass);
            }
            else
            {
                // Show all tutorials, in a browser
                IAlgorithm[] algs = InferenceEngine.GetBuiltInAlgorithms();
                // Avoid max product in the examples browser, as none of the examples apply.
                List <IAlgorithm> algList = new List <IAlgorithm>(algs);
                algList.RemoveAll(alg => alg is MaxProductBeliefPropagation);
                ExamplesViewer tview = new ExamplesViewer(typeof(RunMe), algList.ToArray());
                tview.Run();
            }
        }
Exemple #3
0
        public static void Main()
        {
            Type tutorialClass = null;

            // ********** UNCOMMENT AND EDIT THIS LINE TO RUN A PARTICULAR TUTORIAL DIRECTLY *************
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.FirstExample);


            //Choose one of the algorithms
            InferenceEngine.DefaultEngine.Algorithm = new ExpectationPropagation();
            //InferenceEngine.DefaultEngine.Algorithm = new VariationalMessagePassing();
            //InferenceEngine.DefaultEngine.Algorithm = new GibbsSampling();

            //Options
            InferenceEngine.DefaultEngine.ShowProgress    = true;
            InferenceEngine.DefaultEngine.ShowTimings     = false;
            InferenceEngine.DefaultEngine.ShowMsl         = false;
            InferenceEngine.DefaultEngine.ShowFactorGraph = false;
            InferenceEngine.DefaultEngine.ShowSchedule    = false;

#if NETCORE
            //Tutorials
            //Uncomment one of these lines to run a particular tutorial in console application

            tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.FirstExample);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.TruncatedGaussian);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.TruncatedGaussianEfficient);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.LearningAGaussian);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.LearningAGaussianWithRanges);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.BayesPointMachineExample);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.ClinicalTrial);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.MixtureOfGaussians);

            //String tutorials

            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.HelloStrings);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.StringFormat);

            //Applications

            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.BayesianPCA);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.BugsRats);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.ChessAnalysis);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.ClickModel);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.DifficultyAbility);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.GaussianProcessClassifier);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.MultinomialRegression);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.RecommenderSystem);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.StudentSkills);
            //tutorialClass = typeof(Microsoft.ML.Probabilistic.Tutorials.WetGrassSprinklerRain);
#endif
            if (tutorialClass != null)
            {
                // Run the specified tutorial
                RunTutorial(tutorialClass);
            }
#if NETFULL
            else
            {
                InferenceEngine.Visualizer = new WindowsVisualizer();
                // Show all tutorials, in a browser
                IAlgorithm[] algs = InferenceEngine.GetBuiltInAlgorithms();

                // Avoid max product in the examples browser, as none of the examples apply.
                List <IAlgorithm> algList = new List <IAlgorithm>(algs);
                algList.RemoveAll(alg => alg is MaxProductBeliefPropagation);
                ExamplesViewer tview = new ExamplesViewer(typeof(RunMe), algList.ToArray());
                tview.RunBrowser();
            }
#endif
        }