Changeset 11861 for branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 02/02/15 16:14:45 (10 years ago)
- 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 11 11 <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <TargetFrameworkProfile> 15 15 </TargetFrameworkProfile> … … 46 46 <WarningLevel>4</WarningLevel> 47 47 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 48 <Prefer32Bit>false</Prefer32Bit> 48 49 </PropertyGroup> 49 50 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 55 56 <WarningLevel>4</WarningLevel> 56 57 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 58 <Prefer32Bit>false</Prefer32Bit> 57 59 </PropertyGroup> 58 60 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> … … 64 66 <ErrorReport>prompt</ErrorReport> 65 67 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 68 <Prefer32Bit>false</Prefer32Bit> 66 69 </PropertyGroup> 67 70 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> … … 73 76 <ErrorReport>prompt</ErrorReport> 74 77 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 78 <Prefer32Bit>false</Prefer32Bit> 75 79 </PropertyGroup> 76 80 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 82 86 <ErrorReport>prompt</ErrorReport> 83 87 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 88 <Prefer32Bit>false</Prefer32Bit> 84 89 </PropertyGroup> 85 90 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> … … 91 96 <ErrorReport>prompt</ErrorReport> 92 97 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 98 <Prefer32Bit>false</Prefer32Bit> 93 99 </PropertyGroup> 94 100 <ItemGroup> -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r11310 r11861 155 155 eval: Math.Tan, 156 156 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);160 157 private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory( 161 158 eval: alglib.errorfunction, … … 378 375 return true; 379 376 } 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 } 380 396 } if (node.Symbol is Sine) { 381 397 AutoDiff.Term t; … … 403 419 } else { 404 420 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);415 421 return true; 416 422 } … … 464 470 !(n.Symbol is Logarithm) && 465 471 !(n.Symbol is Exponential) && 472 !(n.Symbol is SquareRoot) && 473 !(n.Symbol is Square) && 466 474 !(n.Symbol is Sine) && 467 475 !(n.Symbol is Cosine) && 468 476 !(n.Symbol is Tangent) && 469 !(n.Symbol is Square) &&470 477 !(n.Symbol is Erf) && 471 478 !(n.Symbol is Norm) && -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r11310 r11861 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 107 108 public SymbolicRegressionSolution(ISymbolicRegressionModel model, IRegressionProblemData problemData) 108 109 : base(model, problemData) { 110 foreach (var node in model.SymbolicExpressionTree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>()) 111 node.SetGrammar(null); 112 109 113 Add(new Result(ModelLengthResultName, "Length of the symbolic regression model.", new IntValue())); 110 114 Add(new Result(ModelDepthResultName, "Depth of the symbolic regression model.", new IntValue()));
Note: See TracChangeset
for help on using the changeset viewer.