Changeset 9632 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions
- Timestamp:
- 06/15/13 11:20:48 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9534,9536-9537,9543
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 9534,9536-9537,9543
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovariancePiecewisePolynomial.cs
r9534 r9632 42 42 } 43 43 44 public I ValueParameter<IntValue> VParameter {45 get { return (I ValueParameter<IntValue>)Parameters["V"]; }44 public IConstrainedValueParameter<IntValue> VParameter { 45 get { return (IConstrainedValueParameter<IntValue>)Parameters["V"]; } 46 46 } 47 47 … … 61 61 62 62 Parameters.Add(new OptionalValueParameter<DoubleValue>("Length", "The length parameter of the isometric piecewise polynomial covariance function.")); 63 Parameters.Add(new OptionalValueParameter<DoubleValue>("Scale", "The scale parameter of the Polynomial covariance function."));63 Parameters.Add(new OptionalValueParameter<DoubleValue>("Scale", "The scale parameter of the piecewise polynomial covariance function.")); 64 64 65 65 var validValues = new ItemSet<IntValue>(new IntValue[] { … … 140 140 var cov = new ParameterizedCovarianceFunction(); 141 141 cov.Covariance = (x, i, j) => { 142 double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length ));142 double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length, columnIndices)); 143 143 return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k); 144 144 }; 145 145 cov.CrossCovariance = (x, xt, i, j) => { 146 double k = Math.Sqrt(Util.SqrDist(x, i, xt, j, 1.0 / length ));146 double k = Math.Sqrt(Util.SqrDist(x, i, xt, j, 1.0 / length, columnIndices)); 147 147 return scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k); 148 148 }; … … 152 152 153 153 private static IEnumerable<double> GetGradient(double[,] x, int i, int j, double length, double scale, int v, double exp, Func<double, double> f, Func<double, double> df, IEnumerable<int> columnIndices) { 154 double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length ));154 double k = Math.Sqrt(Util.SqrDist(x, i, x, j, 1.0 / length, columnIndices)); 155 155 yield return scale * Math.Pow(Math.Max(1.0 - k, 0), exp + v - 1) * k * ((exp + v) * f(k) - Math.Max(1 - k, 0) * df(k)); 156 156 yield return 2.0 * scale * Math.Pow(Math.Max(1 - k, 0), exp + v) * f(k);
Note: See TracChangeset
for help on using the changeset viewer.