Changeset 11594 for branches/Breadcrumbs/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMaternIso.cs
- Timestamp:
- 11/27/14 11:23:37 (9 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Breadcrumbs/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/Breadcrumbs/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceMaternIso.cs
r9456 r11594 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 45 45 get { return (IConstrainedValueParameter<IntValue>)Parameters["D"]; } 46 46 } 47 47 private bool HasFixedScaleParameter { 48 get { return ScaleParameter.Value != null; } 49 } 50 private bool HasFixedInverseLengthParameter { 51 get { return InverseLengthParameter.Value != null; } 52 } 48 53 49 54 [StorableConstructor] … … 76 81 public int GetNumberOfParameters(int numberOfVariables) { 77 82 return 78 ( InverseLengthParameter.Value != null? 0 : 1) +79 ( ScaleParameter.Value != null? 0 : 1);83 (HasFixedInverseLengthParameter ? 0 : 1) + 84 (HasFixedScaleParameter ? 0 : 1); 80 85 } 81 86 … … 90 95 // gather parameter values 91 96 int c = 0; 92 if ( InverseLengthParameter.Value != null) {97 if (HasFixedInverseLengthParameter) { 93 98 inverseLength = InverseLengthParameter.Value.Value; 94 99 } else { … … 97 102 } 98 103 99 if ( ScaleParameter.Value != null) {104 if (HasFixedScaleParameter) { 100 105 scale = ScaleParameter.Value.Value; 101 106 } else { … … 110 115 int d = DParameter.Value.Value; 111 116 GetParameterValues(p, out scale, out inverseLength); 117 var fixedInverseLength = HasFixedInverseLengthParameter; 118 var fixedScale = HasFixedScaleParameter; 112 119 // create functions 113 120 var cov = new ParameterizedCovarianceFunction(); … … 122 129 return scale * m(d, dist); 123 130 }; 124 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, d, scale, inverseLength, columnIndices );131 cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, d, scale, inverseLength, columnIndices, fixedInverseLength, fixedScale); 125 132 return cov; 126 133 } … … 149 156 150 157 151 private static IEnumerable<double> GetGradient(double[,] x, int i, int j, int d, double scale, double inverseLength, IEnumerable<int> columnIndices) { 158 private static IEnumerable<double> GetGradient(double[,] x, int i, int j, int d, double scale, double inverseLength, IEnumerable<int> columnIndices, 159 bool fixedInverseLength, bool fixedScale) { 152 160 double dist = i == j 153 161 ? 0.0 154 162 : Math.Sqrt(Util.SqrDist(x, i, j, Math.Sqrt(d) * inverseLength, columnIndices)); 155 163 156 yield return scale * dm(d, dist);157 yield return 2 * scale * m(d, dist);164 if (!fixedInverseLength) yield return scale * dm(d, dist); 165 if (!fixedScale) yield return 2 * scale * m(d, dist); 158 166 } 159 167 }
Note: See TracChangeset
for help on using the changeset viewer.