Changeset 15249 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/InverseMultiquadraticKernel.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/InverseMultiquadraticKernel.cs
r14891 r15249 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 27 namespace HeuristicLab.Algorithms.DataAnalysis .KernelRidgeRegression{27 namespace HeuristicLab.Algorithms.DataAnalysis { 28 28 [StorableClass] 29 29 [Item("InverseMultiquadraticKernel", "A kernel function that uses the inverse multi-quadratic function 1 / sqrt(1+||x-c||²/beta²). Similar to http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/ with beta as a scaling factor.")] 30 30 public class InverseMultiquadraticKernel : KernelBase { 31 private const double C = 1.0; 31 32 32 private const double C = 1.0;33 #region HLConstructors & Boilerplate34 33 [StorableConstructor] 35 34 protected InverseMultiquadraticKernel(bool deserializing) : base(deserializing) { } 36 [StorableHook(HookType.AfterDeserialization)] 37 private void AfterDeserialization() { } 35 38 36 protected InverseMultiquadraticKernel(InverseMultiquadraticKernel original, Cloner cloner) : base(original, cloner) { } 37 39 38 public InverseMultiquadraticKernel() { } 39 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 41 return new InverseMultiquadraticKernel(this, cloner); 42 42 } 43 #endregion44 43 45 44 protected override double Get(double norm) { 45 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance while Beta is null"); 46 46 var beta = Beta.Value; 47 47 if (Math.Abs(beta) < double.Epsilon) return double.NaN; … … 52 52 //n²/(b³(n²/b² + C)^1.5) 53 53 protected override double GetGradient(double norm) { 54 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance gradient while Beta is null"); 54 55 var beta = Beta.Value; 55 56 if (Math.Abs(beta) < double.Epsilon) return double.NaN;
Note: See TracChangeset
for help on using the changeset viewer.