Changeset 8982 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs
- Timestamp:
- 12/01/12 19:02:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs
r8929 r8982 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Common; … … 45 46 } 46 47 47 public void SetParameter(double[] hyp) {48 if ( hyp.Length > 0) throw new ArgumentException("No hyper-parameters allowed for zero mean function.", "hyp");48 public void SetParameter(double[] p) { 49 if (p.Length > 0) throw new ArgumentException("No parameters allowed for zero mean function.", "p"); 49 50 } 50 51 51 public double[] GetMean(double[,] x) { 52 return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray(); 53 } 54 55 public double[] GetGradients(int k, double[,] x) { 56 if (k > 0) throw new ArgumentException(); 57 return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray(); 52 public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int> columnIndices) { 53 if (p.Length > 0) throw new ArgumentException("No parameters allowed for zero mean function.", "p"); 54 var mf = new ParameterizedMeanFunction(); 55 mf.Mean = (x, i) => 0.0; 56 mf.Gradient = (x, i, k) => { 57 if (k > 0) 58 throw new ArgumentException(); 59 return 0.0; 60 }; 61 return mf; 58 62 } 59 63 }
Note: See TracChangeset
for help on using the changeset viewer.