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/ThinPlatePolysplineKernel.cs

    r14892 r15249  
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2828
    29 namespace HeuristicLab.Algorithms.DataAnalysis.KernelRidgeRegression {
     29namespace HeuristicLab.Algorithms.DataAnalysis {
    3030  [StorableClass]
    3131  // conditionally positive definite. (need to add polynomials) see http://num.math.uni-goettingen.de/schaback/teaching/sc.pdf
     
    3333  public class ThinPlatePolysplineKernel : KernelBase {
    3434
    35     #region Parameternames
    3635    private const string DegreeParameterName = "Degree";
    37     #endregion
    38     #region Parameterproperties
     36
    3937    public IFixedValueParameter<DoubleValue> DegreeParameter {
    40       get { return Parameters[DegreeParameterName] as IFixedValueParameter<DoubleValue>; }
     38      get { return (IFixedValueParameter<DoubleValue>)Parameters[DegreeParameterName]; }
    4139    }
    42     #endregion
    43     #region Properties
    4440    public DoubleValue Degree {
    4541      get { return DegreeParameter.Value; }
    4642    }
    47     #endregion
    4843
    49     #region HLConstructors & Boilerplate
    5044    [StorableConstructor]
    5145    protected ThinPlatePolysplineKernel(bool deserializing) : base(deserializing) { }
    52     [StorableHook(HookType.AfterDeserialization)]
    53     private void AfterDeserialization() { }
     46
    5447    protected ThinPlatePolysplineKernel(ThinPlatePolysplineKernel original, Cloner cloner) : base(original, cloner) { }
     48
    5549    public ThinPlatePolysplineKernel() {
    5650      Parameters.Add(new FixedValueParameter<DoubleValue>(DegreeParameterName, "The degree of the kernel. Needs to be greater than zero.", new DoubleValue(2.0)));
    5751    }
     52
    5853    public override IDeepCloneable Clone(Cloner cloner) {
    5954      return new ThinPlatePolysplineKernel(this, cloner);
    6055    }
    61     #endregion
    6256
    6357    protected override double Get(double norm) {
     58      if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance while Beta is null");
    6459      var beta = Beta.Value;
    6560      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
     
    7166    // (Degree/beta) * (norm/beta)^Degree * log(norm/beta)
    7267    protected override double GetGradient(double norm) {
     68      if (Beta == null) throw new InvalidOperationException("Can not calculate kernel distance gradient while Beta is null");
    7369      var beta = Beta.Value;
    7470      if (Math.Abs(beta) < double.Epsilon) return double.NaN;
Note: See TracChangeset for help on using the changeset viewer.