Changeset 8396 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessHyperparameterInitializer.cs
- Timestamp:
- 08/02/12 17:27:46 (12 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessHyperparameterInitializer.cs
r8375 r8396 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.RealVectorEncoding; 26 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 28 using HeuristicLab.Operators; … … 32 33 namespace HeuristicLab.Algorithms.DataAnalysis { 33 34 [StorableClass] 34 [Item(Name = "GaussianProcess SetHyperparameterLength",35 Description = " Determines the length ofthe hyperparameter vector based on the mean function, covariance function, and number of allowed input variables.")]36 public sealed class GaussianProcess SetHyperparameterLength: SingleSuccessorOperator {35 [Item(Name = "GaussianProcessHyperparameterInitializer", 36 Description = "Initializers the hyperparameter vector based on the mean function, covariance function, and number of allowed input variables.")] 37 public sealed class GaussianProcessHyperparameterInitializer : SingleSuccessorOperator { 37 38 private const string MeanFunctionParameterName = "MeanFunction"; 38 39 private const string CovarianceFunctionParameterName = "CovarianceFunction"; 39 40 private const string ProblemDataParameterName = "ProblemData"; 40 private const string NumberOfHyperparameterParameterName = "NumberOfHyperparameter";41 private const string HyperparameterParameterName = "Hyperparameter"; 41 42 42 43 #region Parameter Properties … … 52 53 } 53 54 // out 54 public ILookupParameter< IntValue> NumberOfHyperparameterParameter {55 get { return (ILookupParameter< IntValue>)Parameters[NumberOfHyperparameterParameterName]; }55 public ILookupParameter<RealVector> HyperparameterParameter { 56 get { return (ILookupParameter<RealVector>)Parameters[HyperparameterParameterName]; } 56 57 } 57 58 #endregion … … 64 65 65 66 [StorableConstructor] 66 private GaussianProcess SetHyperparameterLength(bool deserializing) : base(deserializing) { }67 private GaussianProcess SetHyperparameterLength(GaussianProcessSetHyperparameterLengthoriginal, Cloner cloner) : base(original, cloner) { }68 public GaussianProcess SetHyperparameterLength()67 private GaussianProcessHyperparameterInitializer(bool deserializing) : base(deserializing) { } 68 private GaussianProcessHyperparameterInitializer(GaussianProcessHyperparameterInitializer original, Cloner cloner) : base(original, cloner) { } 69 public GaussianProcessHyperparameterInitializer() 69 70 : base() { 70 71 // in … … 73 74 Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName, "The input data for the Gaussian process.")); 74 75 // out 75 Parameters.Add(new LookupParameter< IntValue>(NumberOfHyperparameterParameterName, "The length of thehyperparameter vector for the Gaussian process model."));76 Parameters.Add(new LookupParameter<RealVector>(HyperparameterParameterName, "The initial hyperparameter vector for the Gaussian process model.")); 76 77 } 77 78 78 79 public override IDeepCloneable Clone(Cloner cloner) { 79 return new GaussianProcess SetHyperparameterLength(this, cloner);80 return new GaussianProcessHyperparameterInitializer(this, cloner); 80 81 } 81 82 82 public override IOperation Apply() 83 { 83 public override IOperation Apply() { 84 84 var inputVariablesCount = ProblemData.AllowedInputVariables.Count(); 85 85 int l = 1 + MeanFunction.GetNumberOfParameters(inputVariablesCount) + 86 86 CovarianceFunction.GetNumberOfParameters(inputVariablesCount); 87 NumberOfHyperparameterParameter.ActualValue = new IntValue(l);87 HyperparameterParameter.ActualValue = new RealVector(l); 88 88 return base.Apply(); 89 89 }
Note: See TracChangeset
for help on using the changeset viewer.