public void VisualizeDigit(ref DigitImage digitImage) { float[] pixels = mnistData.TestImages.Column(currentImage).ToArray(); int label = (int)(mnistData.TestLabels[currentImage]); int predicting = network.mNeurons[network.lastLayerIndex].MaximumIndex(); digitImage.Update(pixels, label, predicting); }
public GUI(uint width, uint height, string title) : base(width, height, title) { Width = (int)width; Height = (int)height; Neurons = new List <Neuron>(); Connections = new List <Connection>(); Visualizer = new NetworkVisualizer(); KeyPressed += new EventHandler <KeyEventArgs>(GUIEvents.OnKeyPress); MouseButtonPressed += new EventHandler <MouseButtonEventArgs>(GUIEvents.OnMouseButtonPress); Neurons = Visualizer.GenerateVisualNeurons(3f, Height, Width); Connections = Visualizer.GenerateVisualConnections(0.5f, ref Neurons); digitImage = new DigitImage(); Visualizer.Visualize(ref Neurons, ref Connections); Visualizer.VisualizeDigit(ref digitImage); }