コード例 #1
0
        private void showItemComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItem selectedItem = (ComboBoxItem)showItemComboBox.SelectedItem;

            if (selectedItem != null)
            {
                int      itemIndex = (int)selectedItem.Tag;
                DataItem dataItem  = dataHolder.Items[itemIndex];
                imageViewer.Draw(dataItem.Inputs);

                if (neuralNetwork != null)
                {
                    neuralNetwork.SetInputs(dataItem.Inputs);
                    neuralNetwork.Propagate();
                    double[] neuralNetOutput = neuralNetwork.GetOutputs();

                    double expectedOutput    = outputConverter.Convert(dataItem.Outputs);
                    double networkOutput     = outputConverter.GetMostProbablyValue(neuralNetOutput);
                    double outputProbability = outputConverter.GetProbability(neuralNetOutput, dataItem.Outputs);

                    expectedOutputLabel.Content    = expectedOutput.ToString();
                    neuralNetOutputLabel.Content   = networkOutput.ToString();
                    outputProbabilityLabel.Content = String.Format("{0:0.00} %", outputProbability);
                }
            }
        }
コード例 #2
0
ファイル: Tester.cs プロジェクト: areksimlat/DigitRecognition
        public void Test(DataItem dataItem)
        {
            PatternOutputs = dataItem.Outputs;

            neuralNetwork.SetInputs(dataItem.Inputs);
            neuralNetwork.Propagate();
            NetworkOutputs = neuralNetwork.GetOutputs();

            ExpectedValue = outputConverter.Convert(PatternOutputs);
            ReceivedValue = outputConverter.GetMostProbablyValue(NetworkOutputs);
            Probability   = outputConverter.GetProbability(NetworkOutputs, PatternOutputs);
        }