Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14016


Ignore:
Timestamp:
07/07/16 13:17:30 (8 years ago)
Author:
gkronber
Message:

#2612: reverse merge of r14015

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs

    r14015 r14016  
    170170        if (node.VarName == TreeNode.NO_VARIABLE)
    171171          return node.Val;
    172         if (columnCache[nodeIdx] == null || double.IsNaN(columnCache[nodeIdx][row])) {
     172        if (columnCache[nodeIdx] == null) {
    173173          if (node.WeightLeft.IsAlmost(-1.0)) throw new InvalidOperationException("Cannot calculate partial dependence for trees loaded from older versions of HeuristicLab.");
    174174          // weighted average for partial dependence plot (recursive here because we need to calculate both sub-trees)
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/ExpressionEvaluator.cs

    r14015 r14016  
    8989
    9090    // pred must be allocated by the caller
    91     // if adjustParameters is set to true we determine parameters in function to make sure that the function output is valid
    92     // e.g. in log(c + f(x)) to make sure that c + f(x) is positive
    93     public void Exec(byte[] code, double[][] vars, double[] consts, double[] pred, bool adjustParameters = false) {
     91    // if adjustOffsetForLogAndExp is set to true we determine c in log(c + f(x)) to make sure that c + f(x) is positive
     92    public void Exec(byte[] code, double[][] vars, double[] consts, double[] pred, bool adjustOffsetForLogAndExp = false) {
    9493      Contract.Assert(pred != null && pred.Length >= vLen);
    9594      int topOfStack = -1;
     
    154153            }
    155154          case (byte)OpCodes.Log: {
    156               if (adjustParameters) {
     155              if (adjustOffsetForLogAndExp) {
    157156                // here we assume that the last used parameter is c in log(f(x) + c)
    158157                // this must match actions for producing code in the automaton!
     
    175174            }
    176175          case (byte)OpCodes.Exp: {
    177               if (adjustParameters) {
     176              if (adjustOffsetForLogAndExp) {
    178177                // here we assume that the last used parameter is c in exp(f(x) * c)
    179178                // this must match actions for producing code in the automaton!
Note: See TracChangeset for help on using the changeset viewer.