Beispiel #1
0
 //Constructor
 /// <summary>
 /// Creates an initialized instance.
 /// </summary>
 /// <param name="preprocessingResults">The preprocessing overview.</param>
 /// <param name="regressionResults">The regression overview.</param>
 public TrainingResults(NeuralPreprocessor.PreprocessingOverview preprocessingResults,
                        ReadoutLayer.RegressionOverview regressionResults
                        )
 {
     PreprocessingResults = preprocessingResults;
     RegressionResults    = regressionResults;
     return;
 }
Beispiel #2
0
 /// <summary>
 /// Displays information about the preprocessing progress and at the end displays important NeuralPreprocessor's statistics.
 /// </summary>
 /// <param name="totalNumOfInputs">Total number of inputs to be processed</param>
 /// <param name="numOfProcessedInputs">Number of processed inputs</param>
 /// <param name="finalPreprocessingOverview">Final overview of the preprocessing phase</param>
 protected void OnPreprocessingProgressChanged(int totalNumOfInputs,
                                               int numOfProcessedInputs,
                                               NeuralPreprocessor.PreprocessingOverview finalPreprocessingOverview
                                               )
 {
     if (finalPreprocessingOverview == null)
     {
         //Display progress
         if (numOfProcessedInputs % 10 == 0 || numOfProcessedInputs == totalNumOfInputs || totalNumOfInputs == 1)
         {
             _log.Write($"    Neural preprocessing and collection of State Machine predictors {totalNumOfInputs}/{numOfProcessedInputs}", true);
         }
     }
     else
     {
         //Display preprocessing final information
         _log.Write(string.Empty);
         _log.Write(finalPreprocessingOverview.CreateReport(4));
         _log.Write(string.Empty);
     }
     return;
 }
Beispiel #3
0
        /// <summary>
        /// Performs the training of the state machine.
        /// </summary>
        /// <param name="trainingData">The training data bundle.</param>
        /// <param name="controller">The build process controller (optional).</param>
        /// <returns>The training results.</returns>
        public TrainingResults Train(VectorBundle trainingData, TNRNetBuilder.BuildControllerDelegate controller = null)
        {
            //StateMachine reset
            Reset();
            VectorBundle readoutTrainingData;

            NeuralPreprocessor.PreprocessingOverview preprocessingOverview = null;
            if (NP == null)
            {
                //Neural preprocessor is bypassed
                readoutTrainingData = trainingData;
            }
            else
            {
                //Neural preprocessing
                readoutTrainingData = NP.InitializeAndPreprocessBundle(trainingData, out preprocessingOverview);
            }
            //Training of the readout layer
            ReadoutLayer.RegressionOverview regressionOverview = RL.Build(readoutTrainingData, BuildPredictorsMapper(), controller, Config.RandomizerSeek);
            //Return the training results
            return(new TrainingResults(preprocessingOverview, regressionOverview));
        }
Beispiel #4
0
        /// <summary>
        /// Performs training of the StateMachine
        /// </summary>
        /// <param name="vectorBundle">Training data bundle (input vectors and desired output vectors)</param>
        /// <param name="regressionController">Optional regression controller.</param>
        /// <returns>Output of the regression stage</returns>
        public TrainingResults Train(VectorBundle vectorBundle, TrainedNetworkBuilder.RegressionControllerDelegate regressionController = null)
        {
            //StateMachine reset
            Reset();
            VectorBundle readoutInput;

            NeuralPreprocessor.PreprocessingOverview preprocessingOverview = null;
            if (NP == null)
            {
                //Neural preprocessor is bypassed
                readoutInput = vectorBundle;
            }
            else
            {
                //Neural preprocessing
                readoutInput = NP.InitializeAndPreprocessBundle(vectorBundle, out preprocessingOverview);
            }
            //Training of the readout layer
            ReadoutLayer.RegressionOverview regressionOverview = RL.Build(readoutInput, BuildPredictorsMapper(), regressionController);
            //Return compact results
            return(new TrainingResults(preprocessingOverview, regressionOverview));
        }