Пример #1
0
        private async void SettingsPage_Loaded(object sender, RoutedEventArgs e)
        {
            trainSetConfig = await TrainSetConfigHelper.ParseConfigJson();

            imageProcessor = new ImageProcessor();
            perceptron     = new Perceptron();

            symbol1TextBlock.Text = trainSetConfig.Train1.Symbol;
            symbol2TextBlock.Text = trainSetConfig.Train2.Symbol;
        }
        private async void InitFields(bool loadModel)
        {
            trainSetConfig = await TrainSetConfigHelper.ParseConfigJson();

            imageProcessor = new ImageProcessor();

            rowCellsCount   = trainSetConfig.ImageWidth;
            columnCellCount = trainSetConfig.ImageHeight;

            cellsCount = rowCellsCount * columnCellCount;

            cells   = new int[cellsCount];
            weights = new double[cellsCount + 1];

            if (loadModel)
            {
                await LoadModel();
            }
            else
            {
                GenerateInitWeightVector();
            }
        }
        public async static Task <TrainConfig> ShowDialogAsync()
        {
            var config = await TrainSetConfigHelper.ParseConfigJson();

            ContentDialog contentDialog = new ContentDialog
            {
                Title               = "Set value",
                Content             = "Choose entered value",
                PrimaryButtonText   = config.Train1.Symbol,
                SecondaryButtonText = config.Train2.Symbol
            };

            var result = await contentDialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                return(config.Train1);
            }
            else
            {
                return(config.Train2);
            }
        }
 private async void InitConfig()
 {
     trainSetConfig = await TrainSetConfigHelper.ParseConfigJson();
 }