Changeset 15249 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/ThinPlatePolysplineKernel.cs
- Timestamp:
- 07/15/17 10:29:40 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14862-14863,14911,14936,15156-15158,15164,15169,15207-15209,15225,15227,15234,15248
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 14862-14863,14911,14936,15156-15158,15164,15169,15207-15209,15225,15227,15234,15248
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/ThinPlatePolysplineKernel.cs
r14892 r15249 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 namespace HeuristicLab.Algorithms.DataAnalysis .KernelRidgeRegression{29 namespace HeuristicLab.Algorithms.DataAnalysis { 30 30 [StorableClass] 31 31 // conditionally positive definite. (need to add polynomials) see http://num.math.uni-goettingen.de/schaback/teaching/sc.pdf … … 33 33 public class ThinPlatePolysplineKernel : KernelBase { 34 34 35 #region Parameternames36 35 private const string DegreeParameterName = "Degree"; 37 #endregion 38 #region Parameterproperties 36 39 37 public IFixedValueParameter<DoubleValue> DegreeParameter { 40 get { return Parameters[DegreeParameterName] as IFixedValueParameter<DoubleValue>; }38 get { return (IFixedValueParameter<DoubleValue>)Parameters[DegreeParameterName]; } 41 39 } 42 #endregion43 #region Properties44 40 public DoubleValue Degree { 45 41 get { return DegreeParameter.Value; } 46 42 } 47 #endregion48 43 49 #region HLConstructors & Boilerplate50 44 [StorableConstructor] 51 45 protected ThinPlatePolysplineKernel(bool deserializing) : base(deserializing) { } 52 [StorableHook(HookType.AfterDeserialization)] 53 private void AfterDeserialization() { } 46 54 47 protected ThinPlatePolysplineKernel(ThinPlatePolysplineKernel original, Cloner cloner) : base(original, cloner) { } 48 55 49 public ThinPlatePolysplineKernel() { 56 50 Parameters.Add(new FixedValueParameter<DoubleValue>(DegreeParameterName, "The degree of the kernel. Needs to be greater than zero.", new DoubleValue(2.0))); 57 51 } 52 58 53 public override IDeepCloneable Clone(Cloner cloner) { 59 54 return new ThinPlatePolysplineKernel(this, cloner); 60 55 } 61 #endregion62 56 63 57 protected override double Get(double norm) { 58 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance while Beta is null"); 64 59 var beta = Beta.Value; 65 60 if (Math.Abs(beta) < double.Epsilon) return double.NaN; … … 71 66 // (Degree/beta) * (norm/beta)^Degree * log(norm/beta) 72 67 protected override double GetGradient(double norm) { 68 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance gradient while Beta is null"); 73 69 var beta = Beta.Value; 74 70 if (Math.Abs(beta) < double.Epsilon) return double.NaN;
Note: See TracChangeset
for help on using the changeset viewer.