Changeset 15249 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/GaussianKernel.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/GaussianKernel.cs
r14891 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 [Item("GaussianKernel", "A kernel function that uses Gaussian function exp(-n²/beta²). As described in http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/")] 32 32 public class GaussianKernel : KernelBase { 33 34 #region HLConstructors & Boilerplate35 33 [StorableConstructor] 36 34 protected GaussianKernel(bool deserializing) : base(deserializing) { } 37 [StorableHook(HookType.AfterDeserialization)] 38 private void AfterDeserialization() { } 35 39 36 protected GaussianKernel(GaussianKernel original, Cloner cloner) : base(original, cloner) { } 37 40 38 public GaussianKernel() { 41 39 } 40 42 41 public override IDeepCloneable Clone(Cloner cloner) { 43 42 return new GaussianKernel(this, cloner); 44 43 } 45 #endregion46 44 47 45 protected override double Get(double norm) { 46 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance while Beta is null"); 48 47 var beta = Beta.Value; 49 48 if (Math.Abs(beta) < double.Epsilon) return double.NaN; … … 54 53 //2 * n²/b²* 1/b * exp(-n²/b²) 55 54 protected override double GetGradient(double norm) { 55 if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance gradient while Beta is null"); 56 56 var beta = Beta.Value; 57 57 if (Math.Abs(beta) < double.Epsilon) return double.NaN;
Note: See TracChangeset
for help on using the changeset viewer.