Changeset 8419 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessHyperparameterInitializer.cs
- Timestamp:
- 08/06/12 18:52:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessHyperparameterInitializer.cs
r8401 r8419 38 38 private const string ProblemDataParameterName = "ProblemData"; 39 39 private const string HyperparameterParameterName = "Hyperparameter"; 40 private const string RandomParameterName = "Random"; 40 41 41 42 #region Parameter Properties … … 49 50 public ILookupParameter<IDataAnalysisProblemData> ProblemDataParameter { 50 51 get { return (ILookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; } 52 } 53 public ILookupParameter<IRandom> RandomParameter { 54 get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; } 51 55 } 52 56 // out … … 71 75 Parameters.Add(new LookupParameter<ICovarianceFunction>(CovarianceFunctionParameterName, "The covariance function for the Gaussian process model.")); 72 76 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.")); 73 78 // out 74 79 Parameters.Add(new LookupParameter<RealVector>(HyperparameterParameterName, "The initial hyperparameter vector for the Gaussian process model.")); … … 83 88 int l = 1 + MeanFunction.GetNumberOfParameters(inputVariablesCount) + 84 89 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; 86 96 return base.Apply(); 87 97 }
Note: See TracChangeset
for help on using the changeset viewer.