Пример #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;
 }
Пример #2
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));
        }
Пример #3
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));
        }