Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/05/14 17:30:38 (11 years ago)
Author:
mkommend
Message:

#1998: Updated classification model comparision branch with trunk changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceFunctions/CovarianceConst.cs

    r8982 r10553  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    3637      get { return (IValueParameter<DoubleValue>)Parameters["Scale"]; }
    3738    }
    38 
     39    private bool HasFixedScaleParameter {
     40      get { return ScaleParameter.Value != null; }
     41    }
    3942    [StorableConstructor]
    4043    private CovarianceConst(bool deserializing)
     
    5962
    6063    public int GetNumberOfParameters(int numberOfVariables) {
    61       return ScaleParameter.Value != null ? 0 : 1;
     64      return HasFixedScaleParameter ? 0 : 1;
    6265    }
    6366
     
    7174      int c = 0;
    7275      // gather parameter values
    73       if (ScaleParameter.Value != null) {
     76      if (HasFixedScaleParameter) {
    7477        scale = ScaleParameter.Value.Value;
    7578      } else {
     
    8790      cov.Covariance = (x, i, j) => scale;
    8891      cov.CrossCovariance = (x, xt, i, j) => scale;
    89       cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices);
     92      if (HasFixedScaleParameter) {
     93        cov.CovarianceGradient = (x, i, j) => Enumerable.Empty<double>();
     94      } else {
     95        cov.CovarianceGradient = (x, i, j) => GetGradient(x, i, j, scale, columnIndices);
     96      }
    9097      return cov;
    9198    }
Note: See TracChangeset for help on using the changeset viewer.