Ejemplo n.º 1
0
        private void TrainCurrentShape(ShapeType shapeType)
        {
            if (!strokes.Any())
            {
                return;
            }

            var trainingSample = Preprocessing.GetTrainingSampleFromShapeFeatures(currentShapeFeatures, shapeType);

            additionalTrainingSamples.Add(trainingSample);

            var allTrainingSamples = initialTrainingSamples.Concat(additionalTrainingSamples).ToList();

            try
            {
                bswTrainingAlgorithm = new BSWTrainingAlgorithm();
                var trainedModel = bswTrainingAlgorithm.Train(allTrainingSamples);
                bswNeuralNetwork = new BSWNeuralNetwork(trainedModel);
            }
            catch (Exception e) { }

            ShowBSWHiddenLayerNodes();
        }