Changeset 10553 for branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs
- Timestamp:
- 03/05/14 17:30:38 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs
r8982 r10553 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 36 37 get { return (IValueParameter<DoubleValue>)Parameters["Scale"]; } 37 38 } 38 39 private bool HasFixedScaleParameter { 40 get { return ScaleParameter.Value != null; } 41 } 39 42 [StorableConstructor] 40 43 private CovarianceConst(bool deserializing) … … 59 62 60 63 public int GetNumberOfParameters(int numberOfVariables) { 61 return ScaleParameter.Value != null? 0 : 1;64 return HasFixedScaleParameter ? 0 : 1; 62 65 } 63 66 … … 71 74 int c = 0; 72 75 // gather parameter values 73 if ( ScaleParameter.Value != null) {76 if (HasFixedScaleParameter) { 74 77 scale = ScaleParameter.Value.Value; 75 78 } else { … … 87 90 cov.Covariance = (x, i, j) => scale; 88 91 cov.CrossCovariance = (x, xt, i, j) => scale; 89 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices); 92 if (HasFixedScaleParameter) { 93 cov.CovarianceGradient = (x, i, j) => Enumerable.Empty<double>(); 94 } else { 95 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices); 96 } 90 97 return cov; 91 98 }
Note: See TracChangeset
for help on using the changeset viewer.