Changeset 14883 for branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/RadialBasisFunctions/KernelFunctions/GaussianKernel.cs
- Timestamp:
- 04/24/17 13:17:43 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/RadialBasisFunctions/KernelFunctions/GaussianKernel.cs
r14872 r14883 47 47 48 48 protected override double Get(double norm) { 49 if (Math.Abs(Beta) < double.Epsilon) return 0;50 return Math. Abs(norm) < double.Epsilon ? 1 : Math.Exp(-norm * norm / (Beta * Beta));49 if (Math.Abs(Beta) < double.Epsilon) return double.NaN; 50 return Math.Exp(-norm * norm / (Beta * Beta)); 51 51 } 52 52 53 53 protected override double GetGradient(double norm) { 54 54 if (Math.Abs(Beta) < double.Epsilon) return double.NaN; 55 norm *= norm; 56 return 2 * norm * Math.Exp(-norm / (Beta * Beta)) / (Beta * Beta * Beta); 55 return 2 * norm * norm / Math.Pow(Beta, 3) * Math.Exp(-norm * norm / (Beta * Beta)); 57 56 } 58 57 }
Note: See TracChangeset
for help on using the changeset viewer.