Changeset 14883 for branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/RadialBasisFunctions/KernelFunctions/MultiquadraticKernel.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/MultiquadraticKernel.cs
r14872 r14883 48 48 #endregion 49 49 protected override double Get(double norm) { 50 return Math.Abs(Beta) < double.Epsilon ? 0 : Math.Sqrt(1 + norm * norm / Beta); 50 if (Math.Abs(Beta) < double.Epsilon) return double.NaN; 51 return Math.Sqrt(1 + norm * norm / Beta); 51 52 } 52 53 53 54 protected override double GetGradient(double norm) { 54 55 if (Math.Abs(Beta) < double.Epsilon) return double.NaN; 55 norm *= norm;56 return -norm / (2 * Beta * Beta * Math.Sqrt((norm + Beta) / Beta));56 var dividend = 2 * Beta * Beta * Math.Sqrt((Beta + norm * norm) / Beta); 57 return -norm * norm / dividend; 57 58 } 58 59 }
Note: See TracChangeset
for help on using the changeset viewer.