Changeset 8455 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSEiso.cs
- Timestamp:
- 08/09/12 09:33:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSEiso.cs
r8416 r8455 101 101 } 102 102 103 public double[] GetGradient(int i, int j) { 104 var res = new double[2]; 105 res[0] = sf2 * Math.Exp(-sd[i, j] / 2.0) * sd[i, j]; 106 res[1] = 2.0 * sf2 * Math.Exp(-sd[i, j] / 2.0); 107 return res; 103 public double GetGradient(int i, int j, int k) { 104 switch (k) { 105 case 0: return sf2 * Math.Exp(-sd[i, j] / 2.0) * sd[i, j]; 106 case 1: return 2.0 * sf2 * Math.Exp(-sd[i, j] / 2.0); 107 default: throw new ArgumentException("CovarianceSEiso has two hyperparameters", "k"); 108 } 108 109 } 109 110
Note: See TracChangeset
for help on using the changeset viewer.