コード例 #1
0
        private void outputBtn_Click(object sender, RoutedEventArgs e)
        {
            if (network == null)
            {
                resultBox.Text = "Najpierw stwórz sieć";
                return;
            }
            if (!FormValidation.isBetaValid(inputBetaBox, out string message))
            {
                resultBox.Text = message;
                return;
            }
            if (!FormValidation.isInputValid(configuration, inputBox, out string inputMessage))
            {
                resultBox.Text = inputMessage;
                return;
            }
            if (!FormValidation.isMinValid(minBox, out string minMessage))
            {
                resultBox.Text = minMessage;
                return;
            }
            if (!FormValidation.isMaxValid(minBox, out string maxMessage))
            {
                resultBox.Text = maxMessage;
                return;
            }
            double min                = double.Parse(minBox.Text);
            double max                = double.Parse(maxBox.Text);
            double inputBeta          = double.Parse(inputBetaBox.Text);
            var    inputs             = Tools.convertStringToDoubleList(inputBox.Text);
            double output             = network.calculateOutput(inputs, inputBeta);
            double denormalizedOutput = Tools.getDenormalizedValue(output, min, max);

            resultBox.Text = denormalizedOutput.ToString();
        }