Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/24/17 18:31:44 (8 years ago)
Author:
gkronber
Message:

#2699: worked on kernel ridge regression. moved beta parameter to algorithm. reintroduced IKernel interface to restrict choice of kernel in kernel ridge regression. speed-up by cholesky decomposition and optimization of the calculation of the covariance matrix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RBFRegression/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/InverseMultiquadraticKernel.cs

    r14883 r14887  
    2222using System;
    2323using HeuristicLab.Common;
    24 using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    26 using HeuristicLab.Parameters;
     24using HeuristicLab.Core;     
    2725using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2826
    29 namespace HeuristicLab.Algorithms.DataAnalysis {
     27namespace HeuristicLab.Algorithms.DataAnalysis.KernelRidgeRegression {
    3028  [StorableClass]
    31   [Item("InverseMultiquadraticKernel", "A kernel function that uses the inverse multiquadratic function")]
     29  [Item("InverseMultiquadraticKernel", "A kernel function that uses the inverse multi-quadratic function  1 / sqrt(1+||x-c||^2/beta). Positive definite: beta > 0")]
    3230  public class InverseMultiquadraticKernel : KernelBase {
    3331    #region HLConstructors & Boilerplate
     
    3836    protected InverseMultiquadraticKernel(InverseMultiquadraticKernel original, Cloner cloner) : base(original, cloner) { }
    3937    public InverseMultiquadraticKernel() {
    40       Parameters.Add(new FixedValueParameter<DoubleValue>(BetaParameterName, "The beta in the kernel function 1 / sqrt(1+||x-c||^2/beta)", new DoubleValue(2)));
    4138    }
    4239    public override IDeepCloneable Clone(Cloner cloner) {
     
    4643
    4744    protected override double Get(double norm) {
    48       if (Math.Abs(Beta) < double.Epsilon) return double.NaN;
    49       return 1 / Math.Sqrt(1 + norm * norm / Beta);
     45      var beta = Beta.Value;
     46      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
     47      return 1 / Math.Sqrt(1 + norm * norm / beta);
    5048    }
    5149
    5250    protected override double GetGradient(double norm) {
    53       if (Math.Abs(Beta) < double.Epsilon) return double.NaN;
    54       return norm * norm / (2 * Beta * Beta * Math.Pow((norm * norm + Beta) / Beta, 1.5));
     51      var beta = Beta.Value;
     52      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
     53      return norm * norm / (2 * beta * beta * Math.Pow((norm * norm + beta) / beta, 1.5));
    5554    }
    5655  }
Note: See TracChangeset for help on using the changeset viewer.