Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/06/12 18:52:22 (12 years ago)
Author:
gkronber
Message:

#1902 changed initialization of hyperparameter vector for GPR using a PRNG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessHyperparameterInitializer.cs

    r8401 r8419  
    3838    private const string ProblemDataParameterName = "ProblemData";
    3939    private const string HyperparameterParameterName = "Hyperparameter";
     40    private const string RandomParameterName = "Random";
    4041
    4142    #region Parameter Properties
     
    4950    public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter {
    5051      get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; }
     52    }
     53    public ILookupParameter<IRandom> RandomParameter {
     54      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
    5155    }
    5256    // out
     
    7175      Parameters.Add(new LookupParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function for the Gaussian process model."));
    7276      Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The input data for the Gaussian process."));
     77      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The pseudo random number generator to use for initializing the hyperparameter vector."));
    7378      // out
    7479      Parameters.Add(new LookupParameter<RealVector>(HyperparameterParameterName, "The initial hyperparameter vector for the Gaussian process model."));
     
    8388      int l = 1 + MeanFunction.GetNumberOfParameters(inputVariablesCount) +
    8489              CovarianceFunction.GetNumberOfParameters(inputVariablesCount);
    85       HyperparameterParameter.ActualValue = new RealVector(l);
     90      var r = new RealVector(l);
     91      var rand = RandomParameter.ActualValue;
     92      for (int i = 0; i < r.Length; i++)
     93        r[i] = rand.NextDouble() * 4 - 2;
     94
     95      HyperparameterParameter.ActualValue = r;
    8696      return base.Apply();
    8797    }
Note: See TracChangeset for help on using the changeset viewer.