예제 #1
0
        public void ShouldConvertAlleLettersToAppropriateValues()
        {
            var input = Helpers.GenerateAllNumberValuesForLetters();

            var output = OutputConverter.Convert(input);

            Assert.AreEqual(Helpers.GenerateAllLetters(), output);
        }
예제 #2
0
        public void ShouldConvertUpperCaseAToAppropriateValue()
        {
            var input = new[] { 27 };

            var output = OutputConverter.Convert(input);

            Assert.AreEqual("A", output);
        }
예제 #3
0
        public void ShouldConvertNumberToProperValue()
        {
            var input = new [] { 1 };

            var output = OutputConverter.Convert(input);

            Assert.AreEqual("a", output);
        }
예제 #4
0
        private void showDataComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (showItemComboBox != null)
            {
                String             selectedValue    = (String)showDataComboBox.SelectedValue;
                DataItem.DataTypes selectedDataType = DataItem.DataTypes.None;

                switch (selectedValue)
                {
                case "Uczące":
                    selectedDataType = DataItem.DataTypes.Learning;
                    break;

                case "Walidujące":
                    selectedDataType = DataItem.DataTypes.Validate;
                    break;

                case "Testowe":
                    selectedDataType = DataItem.DataTypes.Testing;
                    break;
                }

                showItemComboBox.Items.Clear();

                for (int i = 0; i < dataHolder.Items.Count; i++)
                {
                    if (dataHolder.Items[i].dataType == selectedDataType)
                    {
                        showItemComboBox.Items.Add(
                            new ComboBoxItem()
                        {
                            Content = outputConverter.Convert(dataHolder.Items[i].Outputs).ToString(),
                            Tag     = i
                        }
                            );
                    }
                }

                showItemComboBox.SelectedIndex = 0;
            }
        }
예제 #5
0
        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);
        }
예제 #6
0
        public void ShouldThrowErrorForInvalidInput()
        {
            var input = new[] { 0 };

            Assert.Throws <ArgumentException>(() => OutputConverter.Convert(input));
        }