Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/15/17 10:29:40 (7 years ago)
Author:
gkronber
Message:

#2699,#2700
merged r14862, r14863, r14911, r14936, r15156, r15157, r15158, r15164, r15169, r15207:15209, r15225, r15227, r15234, r15248 from trunk to stable

Location:
stable
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/KernelRidgeRegression/KernelFunctions/InverseMultiquadraticKernel.cs

    r14891 r15249  
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    27 namespace HeuristicLab.Algorithms.DataAnalysis.KernelRidgeRegression {
     27namespace HeuristicLab.Algorithms.DataAnalysis {
    2828  [StorableClass]
    2929  [Item("InverseMultiquadraticKernel", "A kernel function that uses the inverse multi-quadratic function  1 / sqrt(1+||x-c||²/beta²). Similar to http://crsouza.com/2010/03/17/kernel-functions-for-machine-learning-applications/ with beta as a scaling factor.")]
    3030  public class InverseMultiquadraticKernel : KernelBase {
     31    private const double C = 1.0;
    3132
    32     private const double C = 1.0;
    33     #region HLConstructors & Boilerplate
    3433    [StorableConstructor]
    3534    protected InverseMultiquadraticKernel(bool deserializing) : base(deserializing) { }
    36     [StorableHook(HookType.AfterDeserialization)]
    37     private void AfterDeserialization() { }
     35
    3836    protected InverseMultiquadraticKernel(InverseMultiquadraticKernel original, Cloner cloner) : base(original, cloner) { }
     37
    3938    public InverseMultiquadraticKernel() { }
     39
    4040    public override IDeepCloneable Clone(Cloner cloner) {
    4141      return new InverseMultiquadraticKernel(this, cloner);
    4242    }
    43     #endregion
    4443
    4544    protected override double Get(double norm) {
     45      if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance while Beta is null");
    4646      var beta = Beta.Value;
    4747      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
     
    5252    //n²/(b³(n²/b² + C)^1.5)
    5353    protected override double GetGradient(double norm) {
     54      if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance gradient while Beta is null");
    5455      var beta = Beta.Value;
    5556      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
Note: See TracChangeset for help on using the changeset viewer.