private GaussianProcessHyperparameterInitializer(GaussianProcessHyperparameterInitializer original, Cloner cloner) : base(original, cloner) { }
Example #2
0
 private GaussianProcessHyperparameterInitializer(GaussianProcessHyperparameterInitializer original, Cloner cloner) : base(original, cloner)
 {
 }
    protected GaussianProcessBase(IDataAnalysisProblem problem)
      : base() {
      Problem = problem;
      Parameters.Add(new ValueParameter<IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
      Parameters.Add(new ValueParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
      Parameters.Add(new ValueParameter<IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
      Parameters.Add(new ValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
      Parameters.Add(new ValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));

      Parameters.Add(new ValueParameter<BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should not be approximated (necessary for LM-BFGS).", new BoolValue(false)));
      Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed

      Parameters.Add(new FixedValueParameter<BoolValue>(ScaleInputValuesParameterName,
        "Determines if the input variable values are scaled to the range [0..1] for training.", new BoolValue(true)));
      Parameters[ScaleInputValuesParameterName].Hidden = true;

      // necessary for BFGS
      Parameters.Add(new ValueParameter<BoolValue>("Maximization", new BoolValue(false)));
      Parameters["Maximization"].Hidden = true;

      var randomCreator = new HeuristicLab.Random.RandomCreator();
      var gpInitializer = new GaussianProcessHyperparameterInitializer();
      var bfgsInitializer = new LbfgsInitializer();
      var makeStep = new LbfgsMakeStep();
      var branch = new ConditionalBranch();
      var modelCreator = new Placeholder();
      var updateResults = new LbfgsUpdateResults();
      var analyzer = new LbfgsAnalyzer();
      var finalModelCreator = new Placeholder();
      var finalAnalyzer = new LbfgsAnalyzer();
      var solutionCreator = new Placeholder();

      OperatorGraph.InitialOperator = randomCreator;
      randomCreator.SeedParameter.ActualName = SeedParameterName;
      randomCreator.SeedParameter.Value = null;
      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
      randomCreator.SetSeedRandomlyParameter.Value = null;
      randomCreator.Successor = gpInitializer;

      gpInitializer.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
      gpInitializer.MeanFunctionParameter.ActualName = MeanFunctionParameterName;
      gpInitializer.ProblemDataParameter.ActualName = Problem.ProblemDataParameter.Name;
      gpInitializer.HyperparameterParameter.ActualName = HyperparameterParameterName;
      gpInitializer.RandomParameter.ActualName = randomCreator.RandomParameter.Name;
      gpInitializer.Successor = bfgsInitializer;

      bfgsInitializer.IterationsParameter.ActualName = MinimizationIterationsParameterName;
      bfgsInitializer.PointParameter.ActualName = HyperparameterParameterName;
      bfgsInitializer.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
      bfgsInitializer.Successor = makeStep;

      makeStep.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
      makeStep.PointParameter.ActualName = HyperparameterParameterName;
      makeStep.Successor = branch;

      branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
      branch.FalseBranch = modelCreator;
      branch.TrueBranch = finalModelCreator;

      modelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
      modelCreator.Successor = updateResults;

      updateResults.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
      updateResults.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
      updateResults.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
      updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
      updateResults.Successor = analyzer;

      analyzer.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
      analyzer.PointParameter.ActualName = HyperparameterParameterName;
      analyzer.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
      analyzer.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
      analyzer.PointsTableParameter.ActualName = "Hyperparameter table";
      analyzer.QualityGradientsTableParameter.ActualName = "Gradients table";
      analyzer.QualitiesTableParameter.ActualName = "Negative log likelihood table";
      analyzer.Successor = makeStep;

      finalModelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
      finalModelCreator.Successor = finalAnalyzer;

      finalAnalyzer.QualityParameter.ActualName = NegativeLogLikelihoodParameterName;
      finalAnalyzer.PointParameter.ActualName = HyperparameterParameterName;
      finalAnalyzer.QualityGradientsParameter.ActualName = HyperparameterGradientsParameterName;
      finalAnalyzer.PointsTableParameter.ActualName = analyzer.PointsTableParameter.ActualName;
      finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
      finalAnalyzer.QualitiesTableParameter.ActualName = analyzer.QualitiesTableParameter.ActualName;
      finalAnalyzer.Successor = solutionCreator;

      solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameterName;
    }
Example #4
0
        protected GaussianProcessBase(IDataAnalysisProblem problem)
            : base()
        {
            Problem = problem;
            Parameters.Add(new ValueParameter <IMeanFunction>(MeanFunctionParameterName, "The mean function to use.", new MeanConst()));
            Parameters.Add(new ValueParameter <ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function to use.", new CovarianceSquaredExponentialIso()));
            Parameters.Add(new ValueParameter <IntValue>(MinimizationIterationsParameterName, "The number of iterations for likelihood optimization with LM-BFGS.", new IntValue(20)));
            Parameters.Add(new ValueParameter <IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
            Parameters.Add(new ValueParameter <BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));

            Parameters.Add(new ValueParameter <BoolValue>(ApproximateGradientsParameterName, "Indicates that gradients should not be approximated (necessary for LM-BFGS).", new BoolValue(false)));
            Parameters[ApproximateGradientsParameterName].Hidden = true; // should not be changed

            Parameters.Add(new FixedValueParameter <BoolValue>(ScaleInputValuesParameterName,
                                                               "Determines if the input variable values are scaled to the range [0..1] for training.", new BoolValue(true)));
            Parameters[ScaleInputValuesParameterName].Hidden = true;

            // necessary for BFGS
            Parameters.Add(new FixedValueParameter <BoolValue>("Maximization (BFGS)", new BoolValue(false)));
            Parameters["Maximization (BFGS)"].Hidden = true;

            var randomCreator     = new HeuristicLab.Random.RandomCreator();
            var gpInitializer     = new GaussianProcessHyperparameterInitializer();
            var bfgsInitializer   = new LbfgsInitializer();
            var makeStep          = new LbfgsMakeStep();
            var branch            = new ConditionalBranch();
            var modelCreator      = new Placeholder();
            var updateResults     = new LbfgsUpdateResults();
            var analyzer          = new LbfgsAnalyzer();
            var finalModelCreator = new Placeholder();
            var finalAnalyzer     = new LbfgsAnalyzer();
            var solutionCreator   = new Placeholder();

            OperatorGraph.InitialOperator                     = randomCreator;
            randomCreator.SeedParameter.ActualName            = SeedParameterName;
            randomCreator.SeedParameter.Value                 = null;
            randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameterName;
            randomCreator.SetSeedRandomlyParameter.Value      = null;
            randomCreator.Successor = gpInitializer;

            gpInitializer.CovarianceFunctionParameter.ActualName = CovarianceFunctionParameterName;
            gpInitializer.MeanFunctionParameter.ActualName       = MeanFunctionParameterName;
            gpInitializer.ProblemDataParameter.ActualName        = Problem.ProblemDataParameter.Name;
            gpInitializer.HyperparameterParameter.ActualName     = HyperparameterParameterName;
            gpInitializer.RandomParameter.ActualName             = randomCreator.RandomParameter.Name;
            gpInitializer.Successor = bfgsInitializer;

            bfgsInitializer.IterationsParameter.ActualName           = MinimizationIterationsParameterName;
            bfgsInitializer.PointParameter.ActualName                = HyperparameterParameterName;
            bfgsInitializer.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
            bfgsInitializer.Successor = makeStep;

            makeStep.StateParameter.ActualName = bfgsInitializer.StateParameter.Name;
            makeStep.PointParameter.ActualName = HyperparameterParameterName;
            makeStep.Successor = branch;

            branch.ConditionParameter.ActualName = makeStep.TerminationCriterionParameter.Name;
            branch.FalseBranch = modelCreator;
            branch.TrueBranch  = finalModelCreator;

            modelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
            modelCreator.Successor = updateResults;

            updateResults.MaximizationParameter.ActualName         = "Maximization (BFGS)";
            updateResults.StateParameter.ActualName                = bfgsInitializer.StateParameter.Name;
            updateResults.QualityParameter.ActualName              = NegativeLogLikelihoodParameterName;
            updateResults.QualityGradientsParameter.ActualName     = HyperparameterGradientsParameterName;
            updateResults.ApproximateGradientsParameter.ActualName = ApproximateGradientsParameterName;
            updateResults.Successor = analyzer;

            analyzer.QualityParameter.ActualName               = NegativeLogLikelihoodParameterName;
            analyzer.PointParameter.ActualName                 = HyperparameterParameterName;
            analyzer.QualityGradientsParameter.ActualName      = HyperparameterGradientsParameterName;
            analyzer.StateParameter.ActualName                 = bfgsInitializer.StateParameter.Name;
            analyzer.PointsTableParameter.ActualName           = "Hyperparameter table";
            analyzer.QualityGradientsTableParameter.ActualName = "Gradients table";
            analyzer.QualitiesTableParameter.ActualName        = "Negative log likelihood table";
            analyzer.Successor = makeStep;

            finalModelCreator.OperatorParameter.ActualName = ModelCreatorParameterName;
            finalModelCreator.Successor = finalAnalyzer;

            finalAnalyzer.QualityParameter.ActualName               = NegativeLogLikelihoodParameterName;
            finalAnalyzer.PointParameter.ActualName                 = HyperparameterParameterName;
            finalAnalyzer.QualityGradientsParameter.ActualName      = HyperparameterGradientsParameterName;
            finalAnalyzer.PointsTableParameter.ActualName           = analyzer.PointsTableParameter.ActualName;
            finalAnalyzer.QualityGradientsTableParameter.ActualName = analyzer.QualityGradientsTableParameter.ActualName;
            finalAnalyzer.QualitiesTableParameter.ActualName        = analyzer.QualitiesTableParameter.ActualName;
            finalAnalyzer.Successor = solutionCreator;

            solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameterName;
        }