Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/24/17 13:17:43 (7 years ago)
Author:
bwerth
Message:

#2699 checked and reformulated gradient functions for kernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/RadialBasisFunctions/KernelFunctions/CicularKernel.cs

    r14872 r14883  
    4747
    4848    protected override double Get(double norm) {
    49       if (norm >= Beta || Math.Abs(Beta) < double.Epsilon) return 0;
     49      if (Math.Abs(Beta) < double.Epsilon) return double.NaN;
     50      if (norm >= Beta) return 0;
    5051      var d = norm / Beta;
    5152      return Math.Acos(-d) - d * Math.Sqrt(1 - d * d) - Math.PI / 2;
     
    5354
    5455    protected override double GetGradient(double norm) {
    55       if (Beta <= 0) return double.NaN;
     56      if (Math.Abs(Beta) < double.Epsilon) return double.NaN;
    5657      if (Beta < norm) return 0;
    57       return 2 * norm * Math.Sqrt(Beta * Beta - norm * norm) / (Beta * Beta * Beta);
     58      return -2*Math.Pow(norm,3)/(Math.Pow(Beta,4)*Math.Sqrt(1-norm*norm/(Beta*Beta)));
    5859    }
    5960  }
Note: See TracChangeset for help on using the changeset viewer.