Changeset 8582
- Timestamp:
- 09/05/12 17:04:30 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessModelView.Designer.cs
r8416 r8582 19 19 */ 20 20 #endregion 21 22 using HeuristicLab.Optimization.Views; 21 23 22 24 namespace HeuristicLab.Algorithms.DataAnalysis.Views { … … 45 47 /// </summary> 46 48 private void InitializeComponent() { 49 this.resultCollectionView = new ResultCollectionView(); 47 50 this.SuspendLayout(); 51 // 52 // resultCollectionView 53 // 54 this.resultCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 55 this.resultCollectionView.Location = new System.Drawing.Point(0, 0); 56 this.resultCollectionView.Name = "resultCollectionView"; 57 this.resultCollectionView.Size = new System.Drawing.Size(253, 251); 58 this.resultCollectionView.TabIndex = 0; 48 59 // 49 60 // GaussianProcessModelView … … 51 62 this.AllowDrop = true; 52 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 64 this.Controls.Add(this.resultCollectionView); 53 65 this.Name = "GaussianProcessModelView"; 54 66 this.Size = new System.Drawing.Size(253, 251); … … 59 71 #endregion 60 72 61 73 private ResultCollectionView resultCollectionView; 62 74 63 75 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessModelView.cs
r8416 r8582 21 21 22 22 using System.Windows.Forms; 23 using HeuristicLab.Data; 23 24 using HeuristicLab.MainForm; 24 25 using HeuristicLab.MainForm.WindowsForms; 26 using HeuristicLab.Optimization; 25 27 26 28 namespace HeuristicLab.Algorithms.DataAnalysis.Views { … … 31 33 public new IGaussianProcessModel Content { 32 34 get { return (IGaussianProcessModel)base.Content; } 33 set { base.Content = value; } 35 set { 36 base.Content = value; 37 } 34 38 } 35 39 … … 43 47 if (Content == null) { 44 48 // clear 49 resultCollectionView.Content = null; 45 50 } else { 46 // update51 resultCollectionView.Content = CreateResultCollection(Content); 47 52 } 53 } 54 55 private ResultCollection CreateResultCollection(IGaussianProcessModel gaussianProcessModel) { 56 var res = new ResultCollection(); 57 res.Add(new Result("Mean Function", gaussianProcessModel.MeanFunction)); 58 res.Add(new Result("Covariance Function", gaussianProcessModel.CovarianceFunction)); 59 res.Add(new Result("Noise sigma", new DoubleValue(gaussianProcessModel.SigmaNoise))); 60 return res; 48 61 } 49 62 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceConst.cs
r8484 r8582 24 24 using HeuristicLab.Common; 25 25 using HeuristicLab.Core; 26 using HeuristicLab.Data; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 … … 30 31 [Item(Name = "CovarianceConst", 31 32 Description = "Constant covariance function for Gaussian processes.")] 32 public class CovarianceConst : Item, ICovarianceFunction { 33 public class CovarianceConst : CovarianceFunction { 34 35 public IValueParameter<DoubleValue> ScaleParameter { 36 get { return scaleParameter; } 37 } 38 33 39 [Storable] 34 private double sf2; 35 public double Scale { get { return sf2; } } 40 private readonly HyperParameter<DoubleValue> scaleParameter; 41 42 [Storable] 43 private double scale; 36 44 37 45 [StorableConstructor] … … 42 50 protected CovarianceConst(CovarianceConst original, Cloner cloner) 43 51 : base(original, cloner) { 44 this.sf2 = original.sf2; 52 this.scaleParameter = cloner.Clone(original.scaleParameter); 53 this.scale = original.scale; 54 55 RegisterEvents(); 45 56 } 46 57 47 58 public CovarianceConst() 48 59 : base() { 60 scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the constant covariance function."); 61 Parameters.Add(scaleParameter); 62 RegisterEvents(); 49 63 } 64 65 [StorableHook(HookType.AfterDeserialization)] 66 private void AfterDeserialization() { 67 RegisterEvents(); 68 } 69 70 // caching 71 private void RegisterEvents() { 72 AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; }); 73 } 74 50 75 51 76 public override IDeepCloneable Clone(Cloner cloner) { … … 53 78 } 54 79 55 public int GetNumberOfParameters(int numberOfVariables) {56 return 1;80 public override int GetNumberOfParameters(int numberOfVariables) { 81 return scaleParameter.Fixed ? 0 : 1; 57 82 } 58 83 59 public void SetParameter(double[] hyp) { 60 if (hyp.Length != 1) throw new ArgumentException("CovarianceConst has only one hyperparameter", "k"); 61 this.sf2 = Math.Exp(2 * hyp[0]); 84 public override void SetParameter(double[] hyp) { 85 if (!scaleParameter.Fixed && hyp.Length == 1) { 86 scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[0]))); 87 } else { 88 throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceConst", "hyp"); 89 } 62 90 } 63 91 64 65 public double GetCovariance(double[,] x, int i, int j) { 66 return sf2; 92 public override double GetCovariance(double[,] x, int i, int j) { 93 return scale; 67 94 } 68 95 69 public IEnumerable<double> GetGradient(double[,] x, int i, int j) {70 yield return 2 * sf2;96 public override IEnumerable<double> GetGradient(double[,] x, int i, int j) { 97 yield return 2.0 * scale; 71 98 } 72 99 73 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {74 return s f2;100 public override double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 101 return scale; 75 102 } 76 103 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinear.cs
r8562 r8582 29 29 [StorableClass] 30 30 [Item(Name = "CovarianceLinear", Description = "Linear covariance function for Gaussian processes.")] 31 public class CovarianceLinear : Item, ICovarianceFunction {32 public int GetNumberOfParameters(int numberOfVariables) {31 public class CovarianceLinear : CovarianceFunction { 32 public override int GetNumberOfParameters(int numberOfVariables) { 33 33 return 0; 34 34 } … … 46 46 } 47 47 48 public void SetParameter(double[] hyp) {48 public override void SetParameter(double[] hyp) { 49 49 if (hyp.Length > 0) throw new ArgumentException("No hyperparameters are allowed for the linear covariance function."); 50 50 } 51 51 52 public double GetCovariance(double[,] x, int i, int j) {52 public override double GetCovariance(double[,] x, int i, int j) { 53 53 return Util.ScalarProd(x, i, j); 54 54 } 55 55 56 public IEnumerable<double> GetGradient(double[,] x, int i, int j) {56 public override IEnumerable<double> GetGradient(double[,] x, int i, int j) { 57 57 yield break; 58 58 } 59 59 60 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {60 public override double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 61 61 return Util.ScalarProd(x, i, xt, j); 62 62 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceLinearArd.cs
r8562 r8582 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 … … 31 32 [Item(Name = "CovarianceLinearArd", 32 33 Description = "Linear covariance function with automatic relevance determination for Gaussian processes.")] 33 public class CovarianceLinearArd : Item, ICovarianceFunction { 34 public class CovarianceLinearArd : CovarianceFunction { 35 public IValueParameter<DoubleArray> InverseLengthParameter { 36 get { return inverseLengthParameter; } 37 } 38 39 [Storable] 40 private HyperParameter<DoubleArray> inverseLengthParameter; 41 34 42 [Storable] 35 43 private double[] inverseLength; 36 public double[] InverseLength {37 get {38 if (inverseLength == null) return null;39 double[] res = new double[inverseLength.Length];40 Array.Copy(inverseLength, res, res.Length);41 return res;42 }43 }44 45 public int GetNumberOfParameters(int numberOfVariables) {46 return numberOfVariables;47 }48 44 49 45 [StorableConstructor] … … 51 47 protected CovarianceLinearArd(CovarianceLinearArd original, Cloner cloner) 52 48 : base(original, cloner) { 53 this.inverseLength = original.InverseLength; // array is copied in the getter 49 inverseLengthParameter = cloner.Clone(original.inverseLengthParameter); 50 if (original.inverseLength != null) { 51 this.inverseLength = new double[original.inverseLength.Length]; 52 Array.Copy(original.inverseLength, inverseLength, inverseLength.Length); 53 } 54 55 RegisterEvents(); 54 56 } 55 57 public CovarianceLinearArd() 56 58 : base() { 59 inverseLengthParameter = new HyperParameter<DoubleArray>("InverseLength", 60 "The inverse length parameter for ARD."); 61 Parameters.Add(inverseLengthParameter); 62 RegisterEvents(); 63 } 64 65 [StorableHook(HookType.AfterDeserialization)] 66 private void AfterDeserialization() { 67 RegisterEvents(); 57 68 } 58 69 … … 61 72 } 62 73 63 public void SetParameter(double[] hyp) { 64 inverseLength = hyp.Select(e => 1.0 / Math.Exp(e)).ToArray(); 74 // caching 75 private void RegisterEvents() { 76 AttachArrayChangeHandler<DoubleArray, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.ToArray(); }); 65 77 } 66 78 67 public double GetCovariance(double[,] x, int i, int j) { 79 80 public override int GetNumberOfParameters(int numberOfVariables) { 81 if (!inverseLengthParameter.Fixed) 82 return numberOfVariables; 83 else 84 return 0; 85 } 86 87 public override void SetParameter(double[] hyp) { 88 if (!inverseLengthParameter.Fixed && hyp.Length > 0) { 89 inverseLengthParameter.SetValue(new DoubleArray(hyp.Select(e => 1.0 / Math.Exp(e)).ToArray())); 90 } else throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceLinearArd", "hyp"); 91 } 92 93 public override double GetCovariance(double[,] x, int i, int j) { 68 94 return Util.ScalarProd(x, i, j, inverseLength); 69 95 } 70 96 71 public IEnumerable<double> GetGradient(double[,] x, int i, int j) {97 public override IEnumerable<double> GetGradient(double[,] x, int i, int j) { 72 98 for (int k = 0; k < inverseLength.Length; k++) { 73 99 yield return -2.0 * x[i, k] * x[j, k] * inverseLength[k] * inverseLength[k]; … … 75 101 } 76 102 77 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {103 public override double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 78 104 return Util.ScalarProd(x, i, xt, j, inverseLength); 79 105 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceMaternIso.cs
r8562 r8582 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 28 using HeuristicLab.Parameters; 26 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 30 … … 30 33 [Item(Name = "CovarianceMaternIso", 31 34 Description = "Matern covariance function for Gaussian processes.")] 32 public class CovarianceMaternIso : Item, ICovarianceFunction { 35 public class CovarianceMaternIso : CovarianceFunction { 36 public IValueParameter<DoubleValue> ScaleParameter { 37 get { return scaleParameter; } 38 } 39 public IValueParameter<DoubleValue> InverseLengthParameter { 40 get { return inverseLengthParameter; } 41 } 42 public IConstrainedValueParameter<IntValue> DParameter { 43 get { return dParameter; } 44 } 45 46 [Storable] 47 private readonly HyperParameter<DoubleValue> inverseLengthParameter; 48 [Storable] 49 private readonly HyperParameter<DoubleValue> scaleParameter; 50 [Storable] 51 private readonly ConstrainedValueParameter<IntValue> dParameter; 52 53 [Storable] 54 private double inverseLength; 33 55 [Storable] 34 56 private double sf2; 35 public double Scale { get { return sf2; } }36 [Storable]37 private double inverseLength;38 public double InverseLength { get { return inverseLength; } }39 57 [Storable] 40 58 private int d; 41 public int D {42 get { return d; }43 set {44 if (value == 1 || value == 3 || value == 5) d = value;45 else throw new ArgumentException("D can only take the values 1, 3, or 5");46 }47 }48 59 49 60 [StorableConstructor] … … 54 65 protected CovarianceMaternIso(CovarianceMaternIso original, Cloner cloner) 55 66 : base(original, cloner) { 67 this.scaleParameter = cloner.Clone(original.scaleParameter); 56 68 this.sf2 = original.sf2; 69 this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter); 57 70 this.inverseLength = original.inverseLength; 71 this.dParameter = cloner.Clone(original.dParameter); 58 72 this.d = original.d; 73 RegisterEvents(); 59 74 } 60 75 61 76 public CovarianceMaternIso() 62 77 : base() { 63 d = 1; 78 inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric Matern covariance function."); 79 scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale parameter of the isometric Matern covariance function."); 80 var validDValues = new ItemSet<IntValue>(); 81 validDValues.Add((IntValue)new IntValue(1).AsReadOnly()); 82 validDValues.Add((IntValue)new IntValue(3).AsReadOnly()); 83 validDValues.Add((IntValue)new IntValue(5).AsReadOnly()); 84 dParameter = new ConstrainedValueParameter<IntValue>("D", "The d parameter (allowed values: 1, 3, or 5) of the isometric Matern covariance function.", validDValues, validDValues.First()); 85 86 Parameters.Add(inverseLengthParameter); 87 Parameters.Add(scaleParameter); 88 Parameters.Add(dParameter); 89 90 RegisterEvents(); 91 } 92 93 [StorableHook(HookType.AfterDeserialization)] 94 private void AfterDeserialization() { 95 RegisterEvents(); 64 96 } 65 97 … … 68 100 } 69 101 70 public int GetNumberOfParameters(int numberOfVariables) { 71 return 2; 102 // caching 103 private void RegisterEvents() { 104 AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; }); 105 AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { sf2 = scaleParameter.Value.Value; }); 106 AttachValueChangeHandler<IntValue, int>(dParameter, () => { d = dParameter.Value.Value; }); 72 107 } 73 108 74 public void SetParameter(double[] hyp) { 75 if (hyp.Length != 2) throw new ArgumentException("CovarianceMaternIso has two hyperparameters", "hyp"); 76 this.inverseLength = 1.0 / Math.Exp(hyp[0]); 77 this.sf2 = Math.Exp(2 * hyp[1]); 109 public override int GetNumberOfParameters(int numberOfVariables) { 110 return 111 (inverseLengthParameter.Fixed ? 0 : 1) + 112 (scaleParameter.Fixed ? 0 : 1); 113 } 114 115 public override void SetParameter(double[] hyp) { 116 int i = 0; 117 if (!inverseLengthParameter.Fixed) { 118 inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i]))); 119 i++; 120 } 121 if (!scaleParameter.Fixed) { 122 scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i]))); 123 i++; 124 } 125 if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovarianceMaternIso", "hyp"); 78 126 } 79 127 … … 101 149 } 102 150 103 public double GetCovariance(double[,] x, int i, int j) {151 public override double GetCovariance(double[,] x, int i, int j) { 104 152 double dist = i == j 105 153 ? 0.0 … … 108 156 } 109 157 110 public IEnumerable<double> GetGradient(double[,] x, int i, int j) {158 public override IEnumerable<double> GetGradient(double[,] x, int i, int j) { 111 159 double dist = i == j 112 160 ? 0.0 … … 117 165 } 118 166 119 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {167 public override double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 120 168 double dist = Math.Sqrt(Util.SqrDist(x, i, xt, j, Math.Sqrt(d) * inverseLength)); 121 169 return sf2 * m(dist); -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovariancePeriodic.cs
r8491 r8582 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 … … 29 31 [StorableClass] 30 32 [Item(Name = "CovariancePeriodic", Description = "Periodic covariance function for Gaussian processes.")] 31 public class CovariancePeriodic : Item, ICovarianceFunction { 33 public class CovariancePeriodic : CovarianceFunction { 34 public IValueParameter<DoubleValue> ScaleParameter { 35 get { return scaleParameter; } 36 } 37 public IValueParameter<DoubleValue> InverseLengthParameter { 38 get { return inverseLengthParameter; } 39 } 40 public IValueParameter<DoubleValue> PeriodParameter { 41 get { return periodParameter; } 42 } 43 32 44 [Storable] 33 private double sf2; 34 public double Scale { get { return sf2; } } 45 private HyperParameter<DoubleValue> scaleParameter; 46 [Storable] 47 private HyperParameter<DoubleValue> inverseLengthParameter; 48 [Storable] 49 private HyperParameter<DoubleValue> periodParameter; 50 51 [Storable] 52 private double scale; 35 53 [Storable] 36 54 private double inverseLength; 37 public double InverseLength { get { return inverseLength; } }38 55 [Storable] 39 private double p; 40 public double Period { get { return p; } } 56 private double period; 41 57 42 public int GetNumberOfParameters(int numberOfVariables) { 43 return 3; 44 } 58 45 59 [StorableConstructor] 46 60 protected CovariancePeriodic(bool deserializing) : base(deserializing) { } 47 61 protected CovariancePeriodic(CovariancePeriodic original, Cloner cloner) 48 62 : base(original, cloner) { 49 sf2 = original.sf2; 50 inverseLength = original.inverseLength; 51 p = original.p; 63 this.scaleParameter = cloner.Clone(original.scaleParameter); 64 this.inverseLengthParameter = cloner.Clone(original.inverseLengthParameter); 65 this.periodParameter = cloner.Clone(original.periodParameter); 66 this.scale = original.scale; 67 this.inverseLength = original.inverseLength; 68 this.period = original.period; 69 70 RegisterEvents(); 52 71 } 72 53 73 public CovariancePeriodic() 54 74 : base() { 75 scaleParameter = new HyperParameter<DoubleValue>("Scale", "The scale of the periodic covariance function."); 76 inverseLengthParameter = new HyperParameter<DoubleValue>("InverseLength", "The inverse length parameter for the periodic covariance function."); 77 periodParameter = new HyperParameter<DoubleValue>("Period", "The period parameter for the periodic covariance function."); 78 Parameters.Add(scaleParameter); 79 Parameters.Add(inverseLengthParameter); 80 Parameters.Add(periodParameter); 81 82 RegisterEvents(); 83 } 84 85 [StorableHook(HookType.AfterDeserialization)] 86 private void AfterDeserialization() { 87 RegisterEvents(); 55 88 } 56 89 … … 59 92 } 60 93 61 public void SetParameter(double[] hyp) {62 if (hyp.Length != 3) throw new ArgumentException();63 this.inverseLength = 1.0 / Math.Exp(hyp[0]);64 this.p = Math.Exp(hyp[1]);65 this.sf2 = Math.Exp(2 * hyp[2]);94 // caching 95 private void RegisterEvents() { 96 AttachValueChangeHandler<DoubleValue, double>(scaleParameter, () => { scale = scaleParameter.Value.Value; }); 97 AttachValueChangeHandler<DoubleValue, double>(inverseLengthParameter, () => { inverseLength = inverseLengthParameter.Value.Value; }); 98 AttachValueChangeHandler<DoubleValue, double>(periodParameter, () => { period = periodParameter.Value.Value; }); 66 99 } 67 100 68 public double GetCovariance(double[,] x, int i, int j) { 101 public override int GetNumberOfParameters(int numberOfVariables) { 102 return 103 (new[] { scaleParameter, inverseLengthParameter, periodParameter }).Count(p => !p.Fixed); 104 } 105 106 public override void SetParameter(double[] hyp) { 107 int i = 0; 108 if (!inverseLengthParameter.Fixed) { 109 inverseLengthParameter.SetValue(new DoubleValue(1.0 / Math.Exp(hyp[i]))); 110 i++; 111 } 112 if (!periodParameter.Fixed) { 113 periodParameter.SetValue(new DoubleValue(Math.Exp(hyp[i]))); 114 i++; 115 } 116 if (!scaleParameter.Fixed) { 117 scaleParameter.SetValue(new DoubleValue(Math.Exp(2 * hyp[i]))); 118 i++; 119 } 120 if (hyp.Length != i) throw new ArgumentException("The length of the parameter vector does not match the number of free parameters for CovariancePeriod", "hyp"); 121 } 122 123 public override double GetCovariance(double[,] x, int i, int j) { 69 124 double k = i == j ? 0.0 : GetDistance(x, x, i, j); 70 k = Math.PI * k / p ;125 k = Math.PI * k / period; 71 126 k = Math.Sin(k) * inverseLength; 72 127 k = k * k; 73 128 74 return s f2* Math.Exp(-2.0 * k);129 return scale * Math.Exp(-2.0 * k); 75 130 } 76 131 77 public IEnumerable<double> GetGradient(double[,] x, int i, int j) {78 double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j) / p ;132 public override IEnumerable<double> GetGradient(double[,] x, int i, int j) { 133 double v = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j) / period; 79 134 double gradient = Math.Sin(v) * inverseLength; 80 135 gradient *= gradient; 81 yield return 4.0 * s f2* Math.Exp(-2.0 * gradient) * gradient;136 yield return 4.0 * scale * Math.Exp(-2.0 * gradient) * gradient; 82 137 double r = Math.Sin(v) * inverseLength; 83 yield return 4.0 * s f2* inverseLength * Math.Exp(-2 * r * r) * r * Math.Cos(v) * v;84 yield return 2.0 * s f2* Math.Exp(-2 * gradient);138 yield return 4.0 * scale * inverseLength * Math.Exp(-2 * r * r) * r * Math.Cos(v) * v; 139 yield return 2.0 * scale * Math.Exp(-2 * gradient); 85 140 } 86 141 87 public double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) {142 public override double GetCrossCovariance(double[,] x, double[,] xt, int i, int j) { 88 143 double k = GetDistance(x, xt, i, j); 89 k = Math.PI * k / p ;144 k = Math.PI * k / period; 90 145 k = Math.Sin(k) * inverseLength; 91 146 k = k * k; 92 147 93 return s f2* Math.Exp(-2.0 * k);148 return scale * Math.Exp(-2.0 * k); 94 149 } 95 150 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r8528 r8582 76 76 [Storable] 77 77 private double sqrSigmaNoise; 78 public double SigmaNoise { 79 get { return Math.Sqrt(sqrSigmaNoise); } 80 } 78 81 79 82 [Storable] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r8565 r8582 120 120 </Compile> 121 121 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 122 <Compile Include="GaussianProcess\HyperParameter.cs" /> 123 <Compile Include="GaussianProcess\CovarianceFunction.cs" /> 122 124 <Compile Include="GaussianProcess\CovarianceRQArd.cs" /> 123 125 <Compile Include="GaussianProcess\CovarianceMaternIso.cs" /> -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs
r8484 r8582 29 29 public interface IGaussianProcessModel : IRegressionModel { 30 30 double NegativeLogLikelihood { get; } 31 double SigmaNoise { get; } 31 32 IMeanFunction MeanFunction { get; } 32 33 ICovarianceFunction CovarianceFunction { get; }
Note: See TracChangeset
for help on using the changeset viewer.