private static TrainerChartPanel <TChart, TSeries, TChartValues, TData> CreateChartPanel <TChart, TSeries, TChartValues, TData>(string title, ITrainer trainer, string hookedValue, ITimeStep timestep, bool averageMode = false) where TChart : Chart, new() where TSeries : Series, new() where TChartValues : IList <TData>, IChartValues, new() { var panel = new TrainerChartPanel <TChart, TSeries, TChartValues, TData>(title, trainer, hookedValue, timestep, averageMode); panel.Fast(); panel.MaxPoints = 50; return(panel); }
private static void Main() { SigmaEnvironment.EnableLogging(); SigmaEnvironment sigma = SigmaEnvironment.Create("Sigma-MNIST"); // create a new mnist trainer ITrainer trainer = CreateMnistTrainer(sigma); // for the UI we have to activate more features if (UI) { // create and attach a new UI framework WPFMonitor gui = sigma.AddMonitor(new WPFMonitor("MNIST")); // create a tab gui.AddTabs("Overview"); // access the window inside the ui thread gui.WindowDispatcher(window => { // enable initialisation window.IsInitializing = true; // add a panel that controls the learning process window.TabControl["Overview"].AddCumulativePanel(new ControlPanel("Control", trainer)); // create an accuracy cost that updates every iteration var cost = new TrainerChartPanel <CartesianChart, LineSeries, TickChartValues <double>, double>("Cost", trainer, "optimiser.cost_total", TimeStep.Every(1, TimeScale.Iteration)); // improve the chart performance cost.Fast(); // add the newly created panel window.TabControl["Overview"].AddCumulativePanel(cost); // finish initialisation window.IsInitializing = false; }); // the operators should not run instantly but when the user clicks play sigma.StartOperatorsOnRun = false; } sigma.Prepare(); sigma.Run(); }