Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/02/15 16:14:45 (10 years ago)
Author:
mkommend
Message:

#2175: Merged trunk changes.

Location:
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r11407 r11861  
    1111    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <TargetFrameworkProfile>
    1515    </TargetFrameworkProfile>
     
    4646    <WarningLevel>4</WarningLevel>
    4747    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     48    <Prefer32Bit>false</Prefer32Bit>
    4849  </PropertyGroup>
    4950  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    5556    <WarningLevel>4</WarningLevel>
    5657    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     58    <Prefer32Bit>false</Prefer32Bit>
    5759  </PropertyGroup>
    5860  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    6466    <ErrorReport>prompt</ErrorReport>
    6567    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     68    <Prefer32Bit>false</Prefer32Bit>
    6669  </PropertyGroup>
    6770  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    7376    <ErrorReport>prompt</ErrorReport>
    7477    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     78    <Prefer32Bit>false</Prefer32Bit>
    7579  </PropertyGroup>
    7680  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    8286    <ErrorReport>prompt</ErrorReport>
    8387    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     88    <Prefer32Bit>false</Prefer32Bit>
    8489  </PropertyGroup>
    8590  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    9196    <ErrorReport>prompt</ErrorReport>
    9297    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     98    <Prefer32Bit>false</Prefer32Bit>
    9399  </PropertyGroup>
    94100  <ItemGroup>
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r11310 r11861  
    155155      eval: Math.Tan,
    156156      diff: x => 1 + Math.Tan(x) * Math.Tan(x));
    157     private static readonly Func<Term, UnaryFunc> square = UnaryFunc.Factory(
    158        eval: x => x * x,
    159        diff: x => 2 * x);
    160157    private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory(
    161158      eval: alglib.errorfunction,
     
    378375          return true;
    379376        }
     377      }
     378      if (node.Symbol is Square) {
     379        AutoDiff.Term t;
     380        if (!TryTransformToAutoDiff(node.GetSubtree(0), variables, parameters, variableNames, out t)) {
     381          term = null;
     382          return false;
     383        } else {
     384          term = AutoDiff.TermBuilder.Power(t, 2.0);
     385          return true;
     386        }
     387      } if (node.Symbol is SquareRoot) {
     388        AutoDiff.Term t;
     389        if (!TryTransformToAutoDiff(node.GetSubtree(0), variables, parameters, variableNames, out t)) {
     390          term = null;
     391          return false;
     392        } else {
     393          term = AutoDiff.TermBuilder.Power(t, 0.5);
     394          return true;
     395        }
    380396      } if (node.Symbol is Sine) {
    381397        AutoDiff.Term t;
     
    403419        } else {
    404420          term = tan(t);
    405           return true;
    406         }
    407       }
    408       if (node.Symbol is Square) {
    409         AutoDiff.Term t;
    410         if (!TryTransformToAutoDiff(node.GetSubtree(0), variables, parameters, variableNames, out t)) {
    411           term = null;
    412           return false;
    413         } else {
    414           term = square(t);
    415421          return true;
    416422        }
     
    464470         !(n.Symbol is Logarithm) &&
    465471         !(n.Symbol is Exponential) &&
     472         !(n.Symbol is SquareRoot) &&
     473         !(n.Symbol is Square) &&
    466474         !(n.Symbol is Sine) &&
    467475         !(n.Symbol is Cosine) &&
    468476         !(n.Symbol is Tangent) &&
    469          !(n.Symbol is Square) &&
    470477         !(n.Symbol is Erf) &&
    471478         !(n.Symbol is Norm) &&
  • branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r11310 r11861  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Data;
     26using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2627using HeuristicLab.Optimization;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    107108    public SymbolicRegressionSolution(ISymbolicRegressionModel model, IRegressionProblemData problemData)
    108109      : base(model, problemData) {
     110      foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
     111        node.SetGrammar(null);
     112
    109113      Add(new Result(ModelLengthResultName, "Length of the symbolic regression model.", new IntValue()));
    110114      Add(new Result(ModelDepthResultName, "Depth of the symbolic regression model.", new IntValue()));
Note: See TracChangeset for help on using the changeset viewer.