Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/01/12 19:02:47 (11 years ago)
Author:
gkronber
Message:

#1902: removed class HyperParameter and changed implementations of covariance and mean functions to remove the parameter value caching and event handlers for parameter caching. Instead it is now possible to create the actual covariance and mean functions as Func from templates and specified parameter values. The instances of mean and covariance functions configured in the GUI are actually templates where the structure and fixed parameters can be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/MeanFunctions/MeanZero.cs

    r8929 r8982  
    2020#endregion
    2121using System;
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using HeuristicLab.Common;
     
    4546    }
    4647
    47     public void SetParameter(double[] hyp) {
    48       if (hyp.Length > 0) throw new ArgumentException("No hyper-parameters allowed for zero mean function.", "hyp");
     48    public void SetParameter(double[] p) {
     49      if (p.Length > 0) throw new ArgumentException("No parameters allowed for zero mean function.", "p");
    4950    }
    5051
    51     public double[] GetMean(double[,] x) {
    52       return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
    53     }
    54 
    55     public double[] GetGradients(int k, double[,] x) {
    56       if (k > 0) throw new ArgumentException();
    57       return Enumerable.Repeat(0.0, x.GetLength(0)).ToArray();
     52    public ParameterizedMeanFunction GetParameterizedMeanFunction(double[] p, IEnumerable<int> columnIndices) {
     53      if (p.Length > 0) throw new ArgumentException("No parameters allowed for zero mean function.", "p");
     54      var mf = new ParameterizedMeanFunction();
     55      mf.Mean = (x, i) => 0.0;
     56      mf.Gradient = (x, i, k) => {
     57        if (k > 0)
     58          throw new ArgumentException();
     59        return 0.0;
     60      };
     61      return mf;
    5862    }
    5963  }
Note: See TracChangeset for help on using the changeset viewer.