Changeset 13784 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialIso.cs
- Timestamp:
- 04/22/16 13:47:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceSquaredExponentialIso.cs
r13721 r13784 126 126 127 127 // order of returned gradients must match the order in GetParameterValues! 128 private static I Enumerable<double> GetGradient(double[,] x, int i, int j, double sf2, double inverseLength, int[] columnIndices,128 private static IList<double> GetGradient(double[,] x, int i, int j, double sf2, double inverseLength, int[] columnIndices, 129 129 bool fixedInverseLength, bool fixedScale) { 130 130 double d = i == j … … 132 132 : Util.SqrDist(x, i, j, columnIndices, inverseLength); 133 133 double g = Math.Exp(-d / 2.0); 134 if (!fixedInverseLength) yield return sf2 * g * d; 135 if (!fixedScale) yield return 2.0 * sf2 * g; 134 var gr = new List<double>(2); 135 if (!fixedInverseLength) gr.Add(sf2 * g * d); 136 if (!fixedScale) gr.Add(2.0 * sf2 * g); 137 return gr; 136 138 } 137 139 }
Note: See TracChangeset
for help on using the changeset viewer.