Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16722


Ignore:
Timestamp:
03/28/19 11:22:24 (5 years ago)
Author:
msemenki
Message:

#2988: Add first version of GP for Evolvment models of models.

Location:
branches/2988_ModelsOfModels2
Files:
25 added
3 deleted
31 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis

  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis/3.4

  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r16565 r16722  
    300300        if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused))
    301301          throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
    302         seed = new FastRandom().NextInt();
     302        seed = RandomSeedGenerator.GetSeed();
    303303
    304304        if (Algorithm == null) return;
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessBase.cs

    r16565 r16722  
    2121#endregion
    2222
    23 using System.Linq;
     23using HEAL.Attic;
    2424using HeuristicLab.Algorithms.GradientDescent;
    2525using HeuristicLab.Common;
     
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    31 using HEAL.Attic;
    3231using HeuristicLab.Problems.DataAnalysis;
     32using System.Linq;
    3333
    3434namespace HeuristicLab.Algorithms.DataAnalysis {
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r16568 r16722  
    4343    <DebugType>full</DebugType>
    4444    <Optimize>false</Optimize>
    45     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     45    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    4646    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4747    <ErrorReport>prompt</ErrorReport>
     
    5353    <DebugType>pdbonly</DebugType>
    5454    <Optimize>true</Optimize>
    55     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     55    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    5656    <DefineConstants>TRACE</DefineConstants>
    5757    <ErrorReport>prompt</ErrorReport>
     
    111111      <Private>False</Private>
    112112    </Reference>
     113    <Reference Include="AutoDiff-1.0">
     114      <HintPath>..\..\..\..\trunk\bin\AutoDiff-1.0.dll</HintPath>
     115      <Private>False</Private>
     116    </Reference>
    113117    <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
    114118      <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
     
    116120    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    117121      <HintPath>..\..\packages\HEAL.Attic.1.0.0-pre02\lib\net461\HEAL.Attic.dll</HintPath>
    118     </Reference>
    119     <Reference Include="LibSVM-3.12, Version=3.12.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    120       <HintPath>..\..\bin\LibSVM-3.12.dll</HintPath>
    121122      <Private>False</Private>
    122123    </Reference>
     124    <Reference Include="HeuristicLab.Algorithms.GradientDescent-3.3">
     125      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Algorithms.GradientDescent-3.3.dll</HintPath>
     126    </Reference>
     127    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3">
     128      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
     129    </Reference>
     130    <Reference Include="HeuristicLab.Analysis-3.3">
     131      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     132    </Reference>
     133    <Reference Include="HeuristicLab.Collections-3.3">
     134      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     135    </Reference>
     136    <Reference Include="HeuristicLab.Common-3.3">
     137      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
     138    </Reference>
     139    <Reference Include="HeuristicLab.Common.Resources-3.3">
     140      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     141    </Reference>
     142    <Reference Include="HeuristicLab.Core-3.3">
     143      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     144    </Reference>
     145    <Reference Include="HeuristicLab.Data-3.3">
     146      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
     147    </Reference>
     148    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3">
     149      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
     150    </Reference>
     151    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     152      <SpecificVersion>False</SpecificVersion>
     153      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     154      <Private>False</Private>
     155    </Reference>
     156    <Reference Include="HeuristicLab.Optimization-3.3">
     157      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     158    </Reference>
     159    <Reference Include="HeuristicLab.Parameters-3.3">
     160      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     161    </Reference>
     162    <Reference Include="HeuristicLab.Persistence-3.3">
     163      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     164    </Reference>
     165    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
     166      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     167    </Reference>
     168    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
     169      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
     170    </Reference>
     171    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4">
     172      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.dll</HintPath>
     173    </Reference>
     174    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4">
     175      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
     176    </Reference>
     177    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4">
     178      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.dll</HintPath>
     179    </Reference>
     180    <Reference Include="HeuristicLab.Problems.Instances-3.3">
     181      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     182    </Reference>
     183    <Reference Include="HeuristicLab.Random-3.3">
     184      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
     185    </Reference>
     186    <Reference Include="HeuristicLab.Selection-3.3">
     187      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Selection-3.3.dll</HintPath>
     188    </Reference>
     189    <Reference Include="LibSVM-3.12">
     190      <HintPath>..\..\..\..\trunk\bin\LibSVM-3.12.dll</HintPath>
     191    </Reference>
    123192    <Reference Include="System" />
    124     <Reference Include="System.Core">
    125       <RequiredTargetFramework>3.5</RequiredTargetFramework>
    126     </Reference>
    127193    <Reference Include="System.Drawing" />
    128     <Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
    129       <HintPath>..\..\packages\System.Drawing.Common.4.5.1\lib\net461\System.Drawing.Common.dll</HintPath>
    130     </Reference>
    131194  </ItemGroup>
    132195  <ItemGroup>
     
    341404  </ItemGroup>
    342405  <ItemGroup>
    343     <ProjectReference Include="..\..\HeuristicLab.Algorithms.GradientDescent\3.3\HeuristicLab.Algorithms.GradientDescent-3.3.csproj">
    344       <Project>{1256B945-EEA9-4BE4-9880-76B5B113F089}</Project>
    345       <Name>HeuristicLab.Algorithms.GradientDescent-3.3</Name>
    346       <Private>False</Private>
    347     </ProjectReference>
    348     <ProjectReference Include="..\..\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm\3.3\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj">
    349       <Project>{F409DD9E-1E9C-4EB1-AA3A-9F6E987C6E58}</Project>
    350       <Name>HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3</Name>
    351     </ProjectReference>
    352     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    353       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    354       <Name>HeuristicLab.Analysis-3.3</Name>
    355       <Private>False</Private>
    356     </ProjectReference>
    357     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    358       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    359       <Name>HeuristicLab.Collections-3.3</Name>
    360       <Private>False</Private>
    361     </ProjectReference>
    362     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    363       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    364       <Name>HeuristicLab.Common.Resources-3.3</Name>
    365       <Private>False</Private>
    366     </ProjectReference>
    367     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    368       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    369       <Name>HeuristicLab.Common-3.3</Name>
    370       <Private>False</Private>
    371     </ProjectReference>
    372     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    373       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    374       <Name>HeuristicLab.Core-3.3</Name>
    375       <Private>False</Private>
    376     </ProjectReference>
    377     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    378       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    379       <Name>HeuristicLab.Data-3.3</Name>
    380       <Private>False</Private>
    381     </ProjectReference>
    382     <ProjectReference Include="..\..\HeuristicLab.Encodings.RealVectorEncoding\3.3\HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj">
    383       <Project>{BB6D334A-4BB6-4674-9883-31A6EBB32CAB}</Project>
    384       <Name>HeuristicLab.Encodings.RealVectorEncoding-3.3</Name>
    385       <Private>False</Private>
    386     </ProjectReference>
    387     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    388       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    389       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    390       <Private>False</Private>
    391     </ProjectReference>
    392     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    393       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    394       <Name>HeuristicLab.Operators-3.3</Name>
    395       <Private>False</Private>
    396     </ProjectReference>
    397     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    398       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    399       <Name>HeuristicLab.Optimization-3.3</Name>
    400       <Private>False</Private>
    401     </ProjectReference>
    402     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    403       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    404       <Name>HeuristicLab.Parameters-3.3</Name>
    405       <Private>False</Private>
    406     </ProjectReference>
    407     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    408       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    409       <Name>HeuristicLab.Persistence-3.3</Name>
    410       <Private>False</Private>
    411     </ProjectReference>
    412     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    413       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    414       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    415       <Private>False</Private>
    416     </ProjectReference>
    417     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj">
    418       <Project>{05BAE4E1-A9FA-4644-AA77-42558720159E}</Project>
    419       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name>
    420       <Private>False</Private>
    421     </ProjectReference>
    422     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
    423       <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
    424       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
    425       <Private>False</Private>
    426     </ProjectReference>
    427     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj">
    428       <Project>{07486E68-1517-4B9D-A58D-A38E99AE71AB}</Project>
    429       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4</Name>
    430     </ProjectReference>
    431     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    432       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    433       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
    434       <Private>False</Private>
    435     </ProjectReference>
    436     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    437       <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    438       <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    439       <Private>False</Private>
    440     </ProjectReference>
    441     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    442       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    443       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    444       <Private>False</Private>
    445     </ProjectReference>
    446     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    447       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    448       <Name>HeuristicLab.Random-3.3</Name>
    449       <Private>False</Private>
    450     </ProjectReference>
    451     <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj">
    452       <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project>
    453       <Name>HeuristicLab.Selection-3.3</Name>
    454     </ProjectReference>
    455   </ItemGroup>
    456   <ItemGroup>
    457406    <None Include="HeuristicLab.snk" />
    458407    <None Include="packages.config" />
     
    476425      <Install>true</Install>
    477426    </BootstrapperPackage>
     427  </ItemGroup>
     428  <ItemGroup>
     429    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
     430      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
     431      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
     432    </ProjectReference>
     433    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     434      <Project>{3d28463f-ec96-4d82-afee-38be91a0ca00}</Project>
     435      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     436    </ProjectReference>
    478437  </ItemGroup>
    479438  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.DataAnalysis/3.4/Plugin.cs.frame

    r16565 r16722  
    4242  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    4343  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    44   [PluginDependency("HeuristicLab.Persistence", "3.3")]
     44  [PluginDependency("HeuristicLab.Attic", "1.0")]
    4545  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4646  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM/Plugin.cs.frame

    r16583 r16722  
    2222using HeuristicLab.PluginInfrastructure;
    2323
    24 namespace HeuristicLab.Algorithms.GeneticAlgorithm {
     24namespace HeuristicLab.Algorithms.EMMAlgorithm {
    2525  /// <summary>
    26   /// Plugin class for HeuristicLab.Algorithms.GeneticAlgorithm plugin.
     26  /// Plugin class for HeuristicLab.Algorithms.EMMAlgorithm plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Algorithms.GeneticAlgorithm", "3.3.15.$WCREV$")]
    29   [PluginFile("HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll", PluginFileType.Assembly)]
     28  [Plugin("HeuristicLab.Algorithms.EMMAlgorithm", "3.3.15.$WCREV$")]
     29  [PluginFile("HeuristicLab.Algorithms.EMMAlgorithm-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
     
    4040  [PluginDependency("HeuristicLab.Random", "3.3")]
    4141  [PluginDependency("HeuristicLab.Selection", "3.3")]
    42   public class HeuristicLabAlgorithmsGeneticAlgorithmPlugin : PluginBase {
     42  [PluginDependency("HeuristicLab.Attic", "1.0")]
     43  public class HeuristicLabAlgorithmsEMMAlgorithmPlugin : PluginBase {
    4344  }
    4445}
  • branches/2988_ModelsOfModels2/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

  • branches/2988_ModelsOfModels2/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r16568 r16722  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5252    <DebugType>pdbonly</DebugType>
    5353    <Optimize>true</Optimize>
    54     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     54    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    5555    <DefineConstants>TRACE</DefineConstants>
    5656    <ErrorReport>prompt</ErrorReport>
     
    100100  </PropertyGroup>
    101101  <ItemGroup>
    102     <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
    103       <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
    104     </Reference>
    105     <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    106       <HintPath>..\..\packages\HEAL.Attic.1.0.0-pre02\lib\net461\HEAL.Attic.dll</HintPath>
     102    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     103      <SpecificVersion>False</SpecificVersion>
     104      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     105    </Reference>
     106    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     107      <SpecificVersion>False</SpecificVersion>
     108      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     111      <SpecificVersion>False</SpecificVersion>
     112      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
     113    </Reference>
     114    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     115      <SpecificVersion>False</SpecificVersion>
     116      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     117    </Reference>
     118    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     119      <SpecificVersion>False</SpecificVersion>
     120      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     123      <SpecificVersion>False</SpecificVersion>
     124      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
     125    </Reference>
     126    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     127      <SpecificVersion>False</SpecificVersion>
     128      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     129      <Private>False</Private>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     132      <SpecificVersion>False</SpecificVersion>
     133      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     134    </Reference>
     135    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     136      <SpecificVersion>False</SpecificVersion>
     137      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     138    </Reference>
     139    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     140      <SpecificVersion>False</SpecificVersion>
     141      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     142    </Reference>
     143    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     144      <SpecificVersion>False</SpecificVersion>
     145      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     146    </Reference>
     147    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     148      <SpecificVersion>False</SpecificVersion>
     149      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     150    </Reference>
     151    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     152      <SpecificVersion>False</SpecificVersion>
     153      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
    107154    </Reference>
    108155    <Reference Include="System" />
     
    111158    </Reference>
    112159    <Reference Include="System.Drawing" />
    113     <Reference Include="System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
    114       <HintPath>..\..\packages\System.Drawing.Common.4.5.1\lib\net461\System.Drawing.Common.dll</HintPath>
    115     </Reference>
    116160    <Reference Include="System.Xml.Linq">
    117161      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     
    138182    <Compile Include="ArchitectureManipulators\SubroutineDuplicater.cs" />
    139183    <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" />
     184    <Compile Include="Grammars\EMMTreeModelGrammar.cs" />
    140185    <Compile Include="Grammars\GrammarUtils.cs" />
    141186    <Compile Include="SymbolicExpressionTreeProblem.cs" />
     
    215260  <ItemGroup>
    216261    <None Include="HeuristicLab.snk" />
    217     <None Include="packages.config" />
    218262    <None Include="Plugin.cs.frame" />
    219263    <None Include="Properties\AssemblyInfo.cs.frame" />
    220   </ItemGroup>
    221   <ItemGroup>
    222     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    223       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    224       <Name>HeuristicLab.Analysis-3.3</Name>
    225       <Private>False</Private>
    226     </ProjectReference>
    227     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    228       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    229       <Name>HeuristicLab.Collections-3.3</Name>
    230       <Private>False</Private>
    231     </ProjectReference>
    232     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    233       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    234       <Name>HeuristicLab.Common.Resources-3.3</Name>
    235       <Private>False</Private>
    236     </ProjectReference>
    237     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    238       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    239       <Name>HeuristicLab.Common-3.3</Name>
    240       <Private>False</Private>
    241     </ProjectReference>
    242     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    243       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    244       <Name>HeuristicLab.Core-3.3</Name>
    245       <Private>False</Private>
    246     </ProjectReference>
    247     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    248       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    249       <Name>HeuristicLab.Data-3.3</Name>
    250       <Private>False</Private>
    251     </ProjectReference>
    252     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    253       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    254       <Name>HeuristicLab.Operators-3.3</Name>
    255       <Private>False</Private>
    256     </ProjectReference>
    257     <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
    258       <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
    259       <Name>HeuristicLab.Optimization.Operators-3.3</Name>
    260       <Private>False</Private>
    261     </ProjectReference>
    262     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    263       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    264       <Name>HeuristicLab.Optimization-3.3</Name>
    265       <Private>False</Private>
    266     </ProjectReference>
    267     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    268       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    269       <Name>HeuristicLab.Parameters-3.3</Name>
    270       <Private>False</Private>
    271     </ProjectReference>
    272     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    273       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    274       <Name>HeuristicLab.Persistence-3.3</Name>
    275       <Private>False</Private>
    276     </ProjectReference>
    277     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    278       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    279       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    280       <Private>False</Private>
    281     </ProjectReference>
    282     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    283       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    284       <Name>HeuristicLab.Random-3.3</Name>
    285       <Private>False</Private>
    286     </ProjectReference>
    287264  </ItemGroup>
    288265  <ItemGroup>
     
    302279      <Install>true</Install>
    303280    </BootstrapperPackage>
     281  </ItemGroup>
     282  <ItemGroup>
     283    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     284      <SpecificVersion>False</SpecificVersion>
     285      <HintPath>..\..\bin\HEAL.Attic.dll</HintPath>
     286      <Private>False</Private>
     287    </Reference>
    304288  </ItemGroup>
    305289  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/2988_ModelsOfModels2/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs

    r16565 r16722  
    5353    void ResetLocalParameters(IRandom random);
    5454    void ShakeLocalParameters(IRandom random, double shakingFactor);
     55    //void ResetLocalParameters(IRandom random, List<ISymbolicExpressionTree> modelSet, List<List<int>> map, List<int> cLusterNumber);
    5556  }
    5657}
  • branches/2988_ModelsOfModels2/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame

    r16565 r16722  
    3737  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    3838  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    39   [PluginDependency("HeuristicLab.Persistence", "3.3")]
     39  [PluginDependency("HeuristicLab.Attic", "1.0")]
    4040  [PluginDependency("HeuristicLab.Random", "3.3")]
    4141  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs

    r16565 r16722  
    2020#endregion
    2121
     22using AutoDiff;
     23using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2224using System;
    2325using System.Collections.Generic;
    2426using System.Linq;
    2527using System.Runtime.Serialization;
    26 using AutoDiff;
    27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    7676      eval: Math.Tan,
    7777      diff: x => 1 + Math.Tan(x) * Math.Tan(x));
    78 
     78    private static readonly Func<Term, UnaryFunc> tanh = UnaryFunc.Factory(
     79      eval: Math.Tanh,
     80      diff: x => 1 - Math.Tanh(x) * Math.Tanh(x));
    7981    private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory(
    8082      eval: alglib.errorfunction,
     
    249251      if (node.Symbol is CubeRoot) {
    250252        return AutoDiff.TermBuilder.Power(
    251           ConvertToAutoDiff(node.GetSubtree(0)), 1.0/3.0);
     253          ConvertToAutoDiff(node.GetSubtree(0)), 1.0 / 3.0);
    252254      }
    253255      if (node.Symbol is Sine) {
     
    261263      if (node.Symbol is Tangent) {
    262264        return tan(
     265          ConvertToAutoDiff(node.GetSubtree(0)));
     266      }
     267      if (node.Symbol is HyperbolicTangent) {
     268        return tanh(
    263269          ConvertToAutoDiff(node.GetSubtree(0)));
    264270      }
     
    321327          !(n.Symbol is Cosine) &&
    322328          !(n.Symbol is Tangent) &&
     329          !(n.Symbol is HyperbolicTangent) &&
    323330          !(n.Symbol is Erf) &&
    324331          !(n.Symbol is Norm) &&
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/InfixExpressionFormatter.cs

    r16565 r16722  
    5151    }
    5252
    53     public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
     53    /// <summary>
     54    /// Produces an infix expression for a given expression tree.
     55    /// </summary>
     56    /// <param name="symbolicExpressionTree">The tree representation of the expression.</param>
     57    /// <param name="numberFormat">Number format that should be used for numeric parameters (e.g. NumberFormatInfo.InvariantInfo (default)).</param>
     58    /// <param name="formatString">The format string for numeric parameters (e.g. \"G4\" to limit to 4 digits, default is \"G\")</param>
     59    /// <returns>Infix expression</returns>
     60    public string Format(ISymbolicExpressionTree symbolicExpressionTree, NumberFormatInfo numberFormat, string formatString="G") {
    5461      // skip root and start symbols
    5562      StringBuilder strBuilder = new StringBuilder();
    56       FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder);
     63      FormatRecursively(symbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0), strBuilder, numberFormat, formatString);
    5764      return strBuilder.ToString();
    5865    }
    5966
    60     private void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder) {
     67    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
     68      return Format(symbolicExpressionTree, NumberFormatInfo.InvariantInfo);
     69    }
     70
     71    private static void FormatRecursively(ISymbolicExpressionTreeNode node, StringBuilder strBuilder, NumberFormatInfo numberFormat, string formatString) {
    6172      if (node.SubtreeCount > 1) {
    6273        var token = GetToken(node.Symbol);
     
    6677            token == "^") {
    6778          strBuilder.Append("(");
    68           FormatRecursively(node.Subtrees.First(), strBuilder);
     79          FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString);
    6980
    7081          foreach (var subtree in node.Subtrees.Skip(1)) {
    7182            strBuilder.Append(" ").Append(token).Append(" ");
    72             FormatRecursively(subtree, strBuilder);
     83            FormatRecursively(subtree, strBuilder, numberFormat, formatString);
    7384          }
    7485          strBuilder.Append(")");
     
    7687          // function with multiple arguments
    7788          strBuilder.Append(token).Append("(");
    78           FormatRecursively(node.Subtrees.First(), strBuilder);
     89          FormatRecursively(node.Subtrees.First(), strBuilder, numberFormat, formatString);
    7990          foreach (var subtree in node.Subtrees.Skip(1)) {
    8091            strBuilder.Append(", ");
    81             FormatRecursively(subtree, strBuilder);
     92            FormatRecursively(subtree, strBuilder, numberFormat, formatString);
    8293          }
    8394          strBuilder.Append(")");
     
    8798        if (token == "-" || token == "NOT") {
    8899          strBuilder.Append("(").Append(token).Append("(");
    89           FormatRecursively(node.GetSubtree(0), strBuilder);
     100          FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString);
    90101          strBuilder.Append("))");
    91102        } else if (token == "/") {
    92103          strBuilder.Append("1/");
    93           FormatRecursively(node.GetSubtree(0), strBuilder);
     104          FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString);
    94105        } else if (token == "+" || token == "*") {
    95           FormatRecursively(node.GetSubtree(0), strBuilder);
     106          FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString);
    96107        } else {
    97108          // function with only one argument
    98109          strBuilder.Append(token).Append("(");
    99           FormatRecursively(node.GetSubtree(0), strBuilder);
     110          FormatRecursively(node.GetSubtree(0), strBuilder, numberFormat, formatString);
    100111          strBuilder.Append(")");
    101112        }
     
    106117          if (!varNode.Weight.IsAlmost(1.0)) {
    107118            strBuilder.Append("(");
    108             strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Weight);
     119            strBuilder.Append(varNode.Weight.ToString(formatString, numberFormat));
    109120            strBuilder.Append("*");
    110121          }
     
    116127          }
    117128          strBuilder.Append(", ")
    118             .AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Lag)
     129            .AppendFormat(numberFormat, "{0}", varNode.Lag)
    119130            .Append(")");
    120131        } else if (node.Symbol is Variable) {
     
    122133          if (!varNode.Weight.IsAlmost(1.0)) {
    123134            strBuilder.Append("(");
    124             strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", varNode.Weight);
     135            strBuilder.Append(varNode.Weight.ToString(formatString, numberFormat));
    125136            strBuilder.Append("*");
    126137          }
     
    141152          }
    142153          strBuilder.AppendFormat("[{0}]",
    143             string.Join(", ", factorNode.Weights.Select(w => w.ToString(CultureInfo.InvariantCulture))));
     154            string.Join(", ", factorNode.Weights.Select(w => w.ToString(formatString, numberFormat))));
    144155        } else if (node.Symbol is BinaryFactorVariable) {
    145156          var factorNode = node as BinaryFactorVariableTreeNode;
    146157          if (!factorNode.Weight.IsAlmost(1.0)) {
    147158            strBuilder.Append("(");
    148             strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", factorNode.Weight);
     159            strBuilder.Append(factorNode.Weight.ToString(formatString, numberFormat));
    149160            strBuilder.Append("*");
    150161          }
     
    168179          var constNode = node as ConstantTreeNode;
    169180          if (constNode.Value >= 0.0)
    170             strBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}", constNode.Value);
     181            strBuilder.Append(constNode.Value.ToString(formatString, numberFormat));
    171182          else
    172             strBuilder.AppendFormat(CultureInfo.InvariantCulture, "({0})", constNode.Value); // (-1
     183            strBuilder.Append("(").Append(constNode.Value.ToString(formatString, numberFormat)).Append(")"); // (-1
    173184        }
    174185      }
    175186    }
    176187
    177     private string GetToken(ISymbol symbol) {
     188    private static string GetToken(ISymbol symbol) {
    178189      var tok = InfixExpressionParser.knownSymbols.GetBySecond(symbol).FirstOrDefault();
    179190      if (tok == null)
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs

    r16565 r16722  
    2626using System.Text;
    2727using System.Text.RegularExpressions;
     28using HEAL.Attic;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
    3031using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    31 using HEAL.Attic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    5656    }
    5757
    58     private string VariableName2Identifier(string name) {     
     58    private string VariableName2Identifier(string name) {
    5959      /*
    6060       * identifier-start-character:
     
    131131        } else if (node.Symbol is Tangent) {
    132132          FormatFunction(node, "Math.Tan", strBuilder);
     133        } else if (node.Symbol is HyperbolicTangent) {
     134          FormatFunction(node, "Math.Tanh", strBuilder);
    133135        } else if (node.Symbol is Square) {
    134136          FormatSquare(node, strBuilder);
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs

    r16565 r16722  
    2525using System.Linq;
    2626using System.Text;
     27using HEAL.Attic;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Core;
    2930using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    30 using HEAL.Attic;
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    192192        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
    193193        stringBuilder.Append(")");
    194 
     194      } else if (symbol is HyperbolicTangent) {
     195        stringBuilder.Append("TANH(");
     196        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     197        stringBuilder.Append(")");
    195198      } else if (symbol is Variable) {
    196199        VariableTreeNode variableTreeNode = node as VariableTreeNode;
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionLatexFormatter.cs

    r16565 r16722  
    2424using System.Linq;
    2525using System.Text;
     26using HEAL.Attic;
    2627using HeuristicLab.Common;
    2728using HeuristicLab.Core;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    29 using HEAL.Attic;
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    137137      } else if (node.Symbol is Tangent) {
    138138        strBuilder.Append(@"\tan \left( ");
     139      } else if (node.Symbol is HyperbolicTangent) {
     140        strBuilder.Append(@"\tanh \left( ");
    139141      } else if (node.Symbol is AiryA) {
    140142        strBuilder.Append(@"\operatorname{airy}_a \left( ");
     
    303305      } else if (node.Symbol is Tangent) {
    304306        throw new InvalidOperationException();
     307      } else if (node.Symbol is HyperbolicTangent) {
     308        throw new InvalidOperationException();
    305309      } else if (node.Symbol is AiryA) {
    306310        throw new InvalidOperationException();
     
    399403      } else if (node.Symbol is Tangent) {
    400404        strBuilder.Append(@" \right) ");
     405      } else if (node.Symbol is HyperbolicTangent) {
     406        strBuilder.Append(@" \right) ");
    401407      } else if (node.Symbol is AiryA) {
    402408        strBuilder.Append(@" \right) ");
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMATLABFormatter.cs

    r16565 r16722  
    2323using System.Linq;
    2424using System.Text;
     25using HEAL.Attic;
    2526using HeuristicLab.Common;
    2627using HeuristicLab.Core;
    2728using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HEAL.Attic;
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    252252      } else if (symbol is Tangent) {
    253253        stringBuilder.Append("tan(");
     254        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     255        stringBuilder.Append(")");
     256      } else if (symbol is HyperbolicTangent) {
     257        stringBuilder.Append("tanh(");
    254258        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
    255259        stringBuilder.Append(")");
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionMathematicaFormatter.cs

    r16565 r16722  
    2424using System.Linq;
    2525using System.Text;
     26using HEAL.Attic;
    2627using HeuristicLab.Common;
    2728using HeuristicLab.Core;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    29 using HEAL.Attic;
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    7070        } else if (node.Symbol is Tangent) {
    7171          FormatFunction(node, "Tan", strBuilder);
     72        } else if (node.Symbol is HyperbolicTangent) {
     73          FormatFunction(node, "Tanh", strBuilder);
    7274        } else if (node.Symbol is Exponential) {
    7375          FormatFunction(node, "Exp", strBuilder);
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionSmalltalkFormatter.cs

    r16565 r16722  
    160160        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
    161161        stringBuilder.Append(" tan");
     162      } else if (symbol is HyperbolicTangent) {
     163        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     164        stringBuilder.Append(" tanh");
    162165      } else if (symbol is Variable) {
    163166        VariableTreeNode variableTreeNode = node as VariableTreeNode;
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/FullFunctionalExpressionGrammar.cs

    r16565 r16722  
    5555      var log = new Logarithm();
    5656      var abs = new Absolute();
     57      var tanh = new HyperbolicTangent();
    5758      var pow = new Power();
    5859      pow.InitialFrequency = 0.0;
     
    120121      constant.MinValue = -20;
    121122      constant.MaxValue = 20;
     123
     124      var treeModel = new TreeModel();
     125
    122126      var variableSymbol = new HeuristicLab.Problems.DataAnalysis.Symbolic.Variable();
    123127      var binFactorVariable = new BinaryFactorVariable();
     
    129133      autoregressiveVariable.Enabled = false;
    130134
    131       var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp,
     135      var allSymbols = new List<Symbol>() { add, sub, mul, div, aq, mean, abs, sin, cos, tan, log, square, cube, pow, sqrt, cubeRoot, root, exp, tanh,
    132136        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral,
    133137        @if, gt, lt, and, or, not,xor, timeLag, integral, derivative, constant, variableSymbol, binFactorVariable, factorVariable, laggedVariable,autoregressiveVariable, variableCondition };
    134       var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, not, timeLag, integral, derivative,
     138      var unaryFunctionSymbols = new List<Symbol>() { abs, square, sqrt, cube, cubeRoot, sin, cos, tan, log, exp, tanh, not, timeLag, integral, derivative,
    135139        airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi, fresnelCosineIntegral, fresnelSineIntegral, gamma, hypCosineIntegral, hypSineIntegral, norm, psi, sineIntegral
    136140      };
     
    138142      var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, aq, variableCondition };
    139143      var ternarySymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or, xor };
    140       var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable };
     144      var terminalSymbols = new List<Symbol>() { variableSymbol, binFactorVariable, factorVariable, constant, laggedVariable, autoregressiveVariable, treeModel };
    141145
    142146      foreach (var symb in allSymbols)
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Grammars/TypeCoherentExpressionGrammar.cs

    r16565 r16722  
    8585      var gamma = new Gamma();
    8686      var hypCosineIntegral = new HyperbolicCosineIntegral();
     87      var tanh = new HyperbolicTangent();
    8788      var hypSineIntegral = new HyperbolicSineIntegral();
    8889      var norm = new Norm();
     
    107108      constant.MinValue = -20;
    108109      constant.MaxValue = 20;
     110
    109111      var variableSymbol = new Variable();
    110112      var binFactorVariable = new BinaryFactorVariable();
     
    112114      var laggedVariable = new LaggedVariable();
    113115      var autoregressiveVariable = new AutoregressiveTargetVariable();
     116
     117      var treeModel = new TreeModel();
    114118      #endregion
    115119
    116120      #region group symbol declaration
    117121      var arithmeticSymbols = new GroupSymbol(ArithmeticFunctionsName, new List<ISymbol>() { add, sub, mul, div, mean });
    118       var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan });
    119       var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log });
     122      var trigonometricSymbols = new GroupSymbol(TrigonometricFunctionsName, new List<ISymbol>() { sin, cos, tan, tanh});
     123      var exponentialAndLogarithmicSymbols = new GroupSymbol(ExponentialFunctionsName, new List<ISymbol> { exp, log});
    120124      var specialFunctions = new GroupSymbol(SpecialFunctionsName, new List<ISymbol> { abs, airyA, airyB, bessel, cosineIntegral, dawson, erf, expIntegralEi,
    121125        fresnelCosineIntegral,fresnelSineIntegral,gamma,hypCosineIntegral,hypSineIntegral,norm, psi, sineIntegral, analyticalQuotient});
    122       var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable });
     126      var terminalSymbols = new GroupSymbol(TerminalsName, new List<ISymbol> { constant, variableSymbol, binFactorVariable, factorVariable, treeModel });
    123127      var realValuedSymbols = new GroupSymbol(RealValuedSymbolsName, new List<ISymbol>() { arithmeticSymbols, trigonometricSymbols, exponentialAndLogarithmicSymbols, specialFunctions, terminalSymbols });
    124128
     
    242246      Symbols.First(s => s is Average).Enabled = false;
    243247      Symbols.First(s => s is Absolute).Enabled = false;
     248      Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    244249      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    245250      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
     
    254259      Symbols.First(s => s is Xor).Enabled = false;
    255260      Symbols.First(s => s is Absolute).Enabled = false;
     261      Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    256262      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    257263      Symbols.First(s => s.Name == ExponentialFunctionsName).Enabled = false;
     
    264270      Symbols.First(s => s is Average).Enabled = false;
    265271      Symbols.First(s => s is Absolute).Enabled = false;
     272      Symbols.First(s => s is HyperbolicTangent).Enabled = false;
    266273      Symbols.First(s => s.Name == TrigonometricFunctionsName).Enabled = false;
    267274      Symbols.First(s => s.Name == PowerFunctionsName).Enabled = false;
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r16568 r16722  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5151    <DebugType>pdbonly</DebugType>
    5252    <Optimize>true</Optimize>
    53     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     53    <OutputPath>..\..\..\..\trunk\bin\</OutputPath>
    5454    <DefineConstants>TRACE</DefineConstants>
    5555    <ErrorReport>prompt</ErrorReport>
     
    100100  <ItemGroup>
    101101    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    102       <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
     102      <HintPath>..\..\..\..\trunk\bin\ALGLIB-3.7.0.dll</HintPath>
    103103      <Private>False</Private>
    104104    </Reference>
    105105    <Reference Include="AutoDiff-1.0, Version=1.0.0.14388, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    106       <HintPath>..\..\bin\AutoDiff-1.0.dll</HintPath>
    107       <Private>False</Private>
    108     </Reference>
    109     <Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
    110       <HintPath>..\..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
     106      <HintPath>..\..\..\..\trunk\bin\AutoDiff-1.0.dll</HintPath>
     107      <Private>False</Private>
    111108    </Reference>
    112109    <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    113110      <HintPath>..\..\packages\HEAL.Attic.1.0.0-pre02\lib\net461\HEAL.Attic.dll</HintPath>
     111      <Private>False</Private>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     114      <SpecificVersion>False</SpecificVersion>
     115      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     116      <Private>False</Private>
     117    </Reference>
     118    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     119      <SpecificVersion>False</SpecificVersion>
     120      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     121      <Private>False</Private>
     122    </Reference>
     123    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     124      <SpecificVersion>False</SpecificVersion>
     125      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
     126      <Private>False</Private>
     127    </Reference>
     128    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     129      <SpecificVersion>False</SpecificVersion>
     130      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     131      <Private>False</Private>
     132    </Reference>
     133    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     134      <SpecificVersion>False</SpecificVersion>
     135      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     136      <Private>False</Private>
     137    </Reference>
     138    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     139      <SpecificVersion>False</SpecificVersion>
     140      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
     141      <Private>False</Private>
     142    </Reference>
     143    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     144      <SpecificVersion>False</SpecificVersion>
     145      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     146    </Reference>
     147    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     148      <SpecificVersion>False</SpecificVersion>
     149      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     150      <Private>False</Private>
     151    </Reference>
     152    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     153      <SpecificVersion>False</SpecificVersion>
     154      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     155      <Private>False</Private>
     156    </Reference>
     157    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     158      <SpecificVersion>False</SpecificVersion>
     159      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     160      <Private>False</Private>
     161    </Reference>
     162    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     163      <SpecificVersion>False</SpecificVersion>
     164      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     165      <Private>False</Private>
     166    </Reference>
     167    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     168      <SpecificVersion>False</SpecificVersion>
     169      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     170      <Private>False</Private>
     171    </Reference>
     172    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     173      <SpecificVersion>False</SpecificVersion>
     174      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
     175      <Private>False</Private>
    114176    </Reference>
    115177    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1, Version=0.0.0.1, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    116178      <SpecificVersion>False</SpecificVersion>
    117       <HintPath>..\..\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll</HintPath>
     179      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll</HintPath>
     180      <Private>False</Private>
     181    </Reference>
     182    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     183      <SpecificVersion>False</SpecificVersion>
     184      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     185      <Private>False</Private>
     186    </Reference>
     187    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     188      <SpecificVersion>False</SpecificVersion>
     189      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
     190      <Private>False</Private>
     191    </Reference>
     192    <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     193      <SpecificVersion>False</SpecificVersion>
     194      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Selection-3.3.dll</HintPath>
    118195      <Private>False</Private>
    119196    </Reference>
     
    136213  </ItemGroup>
    137214  <ItemGroup>
     215    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionNeastedTreeSyzeAnalyzer.cs" />
     216    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeVariablesNumberAnalyzer.cs" />
     217    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeComplexcityAnalyzer.cs" />
    138218    <Compile Include="Analyzers\SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs" />
    139219    <Compile Include="Analyzers\SymbolicDataAnalysisBuildingBlockAnalyzer.cs" />
     
    176256    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs" />
    177257    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeNativeInterpreter.cs" />
     258    <Compile Include="Selectors\DiversitySelector.cs" />
    178259    <Compile Include="SymbolicDataAnalysisExpressionTreeSimplificationOperator.cs" />
    179260    <Compile Include="SymbolicDataAnalysisModelComplexityCalculator.cs" />
     
    239320    <Compile Include="Symbols\Absolute.cs" />
    240321    <Compile Include="Symbols\CubeRoot.cs" />
     322    <Compile Include="Symbols\HyperbolicTangent.cs" />
     323    <Compile Include="Symbols\ModelTreeNode.cs" />
    241324    <Compile Include="Symbols\VariableBase.cs" />
    242325    <Compile Include="Symbols\VariableTreeNodeBase.cs" />
     
    293376    <Compile Include="TreeMatching\SymbolicExpressionTreeNodeEqualityComparer.cs" />
    294377    <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" />
     378    <Compile Include="Symbols\TreeModel.cs" />
    295379    <None Include="HeuristicLab.snk" />
    296380    <None Include="packages.config" />
     
    328412  </ItemGroup>
    329413  <ItemGroup>
    330     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    331       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    332       <Name>HeuristicLab.Analysis-3.3</Name>
    333       <Private>False</Private>
    334     </ProjectReference>
    335     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    336       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    337       <Name>HeuristicLab.Collections-3.3</Name>
    338       <Private>False</Private>
    339     </ProjectReference>
    340     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    341       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    342       <Name>HeuristicLab.Common.Resources-3.3</Name>
    343       <Private>False</Private>
    344     </ProjectReference>
    345     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    346       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    347       <Name>HeuristicLab.Common-3.3</Name>
    348       <Private>False</Private>
    349     </ProjectReference>
    350     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    351       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    352       <Name>HeuristicLab.Core-3.3</Name>
    353       <Private>False</Private>
    354     </ProjectReference>
    355     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    356       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    357       <Name>HeuristicLab.Data-3.3</Name>
    358       <Private>False</Private>
    359     </ProjectReference>
    360414    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    361415      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    362416      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    363       <Private>False</Private>
    364     </ProjectReference>
    365     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    366       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    367       <Name>HeuristicLab.Operators-3.3</Name>
    368       <Private>False</Private>
    369     </ProjectReference>
    370     <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
    371       <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
    372       <Name>HeuristicLab.Optimization.Operators-3.3</Name>
    373       <Private>False</Private>
    374     </ProjectReference>
    375     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    376       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    377       <Name>HeuristicLab.Optimization-3.3</Name>
    378     </ProjectReference>
    379     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    380       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    381       <Name>HeuristicLab.Parameters-3.3</Name>
    382       <Private>False</Private>
    383     </ProjectReference>
    384     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    385       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    386       <Name>HeuristicLab.Persistence-3.3</Name>
    387       <Private>False</Private>
    388     </ProjectReference>
    389     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    390       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    391       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    392       <Private>False</Private>
    393     </ProjectReference>
    394     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    395       <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    396       <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    397       <Private>False</Private>
    398     </ProjectReference>
    399     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    400       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    401       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    402       <Private>False</Private>
    403     </ProjectReference>
    404     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    405       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    406       <Name>HeuristicLab.Random-3.3</Name>
    407417      <Private>False</Private>
    408418    </ProjectReference>
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/InfixExpressionParser.cs

    r16565 r16722  
    8484    private Constant constant = new Constant();
    8585    private Variable variable = new Variable();
     86    private TreeModel treeModel = new TreeModel();
    8687    private BinaryFactorVariable binaryFactorVar = new BinaryFactorVariable();
    8788    private FactorVariable factorVar = new FactorVariable();
     
    111112        { "COS", new Cosine()},
    112113        { "TAN", new Tangent()},
     114        { "TANH", new HyperbolicTangent()},
    113115        { "AIRYA", new AiryA()},
    114116        { "AIRYB", new AiryB()},
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Importer/SymbolicExpressionImporter.cs

    r16565 r16722  
    5353        {"COS", new Cosine()},
    5454        {"TAN", new Tangent()},
     55        {"TANH", new HyperbolicTangent ()},
    5556        {"AIRYA", new AiryA()},
    5657        {"AIRYB", new AiryB()},
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/BatchOperations.cs

    r16356 r16722  
    6969        a[i] = Math.Tan(b[i]);
    7070    }
     71    public static void Tanh(double[] a, double[] b) {
     72      for (int i = 0; i < BATCHSIZE; ++i)
     73        a[i] = Math.Tanh(b[i]);
     74    }
    7175
    7276    public static void Pow(double[] a, double[] b) {
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs

    r16565 r16722  
    8888      var outputInterval = Evaluate(instructions, ref instructionCount);
    8989
    90       return outputInterval;
     90      // because of numerical errors the bounds might be incorrect
     91      if (outputInterval.LowerBound <= outputInterval.UpperBound)
     92        return outputInterval;
     93      else
     94        return new Interval(outputInterval.UpperBound, outputInterval.LowerBound);
    9195    }
    9296
     
    102106      var outputInterval = Evaluate(instructions, ref instructionCount, intervals);
    103107
    104       nodeIntervals = intervals;
    105 
    106       return outputInterval;
     108      // fix incorrect intervals if necessary (could occur because of numerical errors)
     109      nodeIntervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>();
     110      foreach(var kvp in intervals) {
     111        var interval = kvp.Value;
     112        if (interval.IsInfiniteOrUndefined || interval.LowerBound <= interval.UpperBound)
     113          nodeIntervals.Add(kvp.Key, interval);
     114        else
     115          nodeIntervals.Add(kvp.Key, new Interval(interval.UpperBound, interval.LowerBound));
     116      }
     117
     118      // because of numerical errors the bounds might be incorrect
     119      if (outputInterval.IsInfiniteOrUndefined || outputInterval.LowerBound <= outputInterval.UpperBound)
     120        return outputInterval;
     121      else
     122        return new Interval(outputInterval.UpperBound, outputInterval.LowerBound);
    107123    }
    108124
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/OpCodes.cs

    r16565 r16722  
    9090    public const byte CubeRoot = 51;
    9191
     92    public const byte Tanh = 52;
     93    public const byte TreeModel = 53;
     94
    9295
    9396    private static Dictionary<Type, byte> symbolToOpcode = new Dictionary<Type, byte>() {
     
    99102      { typeof(Cosine), OpCodes.Cos },
    100103      { typeof(Tangent), OpCodes.Tan },
     104      { typeof (HyperbolicTangent), OpCodes.Tanh},
    101105      { typeof(Logarithm), OpCodes.Log },
    102106      { typeof(Exponential), OpCodes.Exp },
     
    114118      { typeof(AutoregressiveTargetVariable),OpCodes.LagVariable},
    115119      { typeof(Constant), OpCodes.Constant },
     120      { typeof(TreeModel), OpCodes.TreeModel },
    116121      { typeof(Argument), OpCodes.Arg },
    117122      { typeof(Power),OpCodes.Power},
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs

    r16565 r16722  
    4545    private static readonly MethodInfo Cos = typeof(Math).GetMethod("Cos", new[] { typeof(double) });
    4646    private static readonly MethodInfo Tan = typeof(Math).GetMethod("Tan", new[] { typeof(double) });
     47    private static readonly MethodInfo Tanh = typeof(Math).GetMethod("Tanh", new[] { typeof(double) });
    4748    private static readonly MethodInfo Sqrt = typeof(Math).GetMethod("Sqrt", new[] { typeof(double) });
    4849    private static readonly MethodInfo Floor = typeof(Math).GetMethod("Floor", new[] { typeof(double) });
     
    223224            return Expression.Call(Tan, arg);
    224225          }
     226        case OpCodes.Tanh: {
     227            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
     228            return Expression.Call(Tanh, arg);
     229          }
    225230        case OpCodes.Square: {
    226231            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs

    r16565 r16722  
    5151      }
    5252    }
    53 
     53    private void SubTreeEvoluate(BatchInstruction instr, int[] rows, int rowIndex, int batchSize) {
     54      for (int i = 0; i < batchSize; ++i) {
     55        var row = rows[rowIndex] + i;
     56        instr.buf[i] = instr.data[row];  // не забыть заполнить
     57      }
     58    }
    5459    private void Evaluate(BatchInstruction[] code, int[] rows, int rowIndex, int batchSize) {
    5560      for (int i = code.Length - 1; i >= 0; --i) {
     
    6166          case OpCodes.Variable: {
    6267              LoadData(instr, rows, rowIndex, batchSize);
     68              break;
     69            }
     70          case OpCodes.TreeModel: {
     71              SubTreeEvoluate(instr, rows, rowIndex, batchSize);
    6372              break;
    6473            }
     
    159168              break;
    160169            }
    161 
     170          case OpCodes.Tanh: {
     171              Tanh(instr.buf, code[c].buf);
     172              break;
     173            }
    162174          case OpCodes.Absolute: {
    163175              Absolute(instr.buf, code[c].buf);
     
    201213      }
    202214
    203       var code = Compile(tree, dataset, OpCodes.MapSymbolToOpCode);
     215      var code = Compile(tree, dataset, OpCodes.MapSymbolToOpCode, rows);
    204216      var remainingRows = rows.Length % BATCHSIZE;
    205217      var roundedTotal = rows.Length - remainingRows;
     
    233245    }
    234246
    235     private BatchInstruction[] Compile(ISymbolicExpressionTree tree, IDataset dataset, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper) {
     247    private BatchInstruction[] Compile(ISymbolicExpressionTree tree, IDataset dataset, Func<ISymbolicExpressionTreeNode, byte> opCodeMapper, int[] rows) {
    236248      var root = tree.Root.GetSubtree(0).GetSubtree(0);
    237249      var code = new BatchInstruction[root.GetLength()];
    238250      if (root.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)");
    239251      int c = 1, i = 0;
     252      var allRows = Enumerable.Range(0, dataset.Rows).ToArray();
    240253      foreach (var node in root.IterateNodesBreadth()) {
    241254        if (node.SubtreeCount > ushort.MaxValue) throw new ArgumentException("Number of subtrees is too big (>65.535)");
     
    258271          for (int j = 0; j < BATCHSIZE; ++j)
    259272            code[i].buf[j] = code[i].value;
     273        } else if (node is TreeModelTreeNode subtree) {
     274          code[i].data = GetValues(subtree.Tree, dataset, allRows);
     275          EvaluatedSolutions--;
    260276        }
    261277        c += node.SubtreeCount;
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r16565 r16722  
    4545    private static MethodInfo sin = typeof(Math).GetMethod("Sin", new Type[] { typeof(double) });
    4646    private static MethodInfo tan = typeof(Math).GetMethod("Tan", new Type[] { typeof(double) });
     47    private static MethodInfo tanh = typeof(Math).GetMethod("Tanh", new Type[] { typeof(double) });
    4748    private static MethodInfo exp = typeof(Math).GetMethod("Exp", new Type[] { typeof(double) });
    4849    private static MethodInfo log = typeof(Math).GetMethod("Log", new Type[] { typeof(double) });
     
    285286            return;
    286287          }
     288        case OpCodes.Tanh: {
     289            CompileInstructions(il, state, ds);
     290            il.Emit(System.Reflection.Emit.OpCodes.Call, tanh);
     291            return;
     292          }
    287293        case OpCodes.Power: {
    288294            CompileInstructions(il, state, ds);
     
    425431            Label c1 = il.DefineLabel();
    426432            CompileInstructions(il, state, ds);
    427             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
     433            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
    428434            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
    429435            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, c1);
     
    440446            CompileInstructions(il, state, ds);
    441447            for (int i = 1; i < nArgs; i++) {
    442               il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
     448              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
    443449              il.Emit(System.Reflection.Emit.OpCodes.Cgt);
    444450              il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
    445451              CompileInstructions(il, state, ds);
    446452            }
    447             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
     453            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
    448454            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
    449455            il.Emit(System.Reflection.Emit.OpCodes.Brfalse, falseBranch);
     
    465471              // complex definition because of special properties of NaN 
    466472              il.Emit(System.Reflection.Emit.OpCodes.Dup);
    467               il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // <= 0       
     473              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // <= 0       
    468474              il.Emit(System.Reflection.Emit.OpCodes.Ble, nextArgBranch);
    469475              il.Emit(System.Reflection.Emit.OpCodes.Br, resultBranch);
     
    473479            }
    474480            il.MarkLabel(resultBranch);
    475             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
     481            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
    476482            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
    477483            il.Emit(System.Reflection.Emit.OpCodes.Brtrue, trueBranch);
     
    486492        case OpCodes.NOT: {
    487493            CompileInstructions(il, state, ds);
    488             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0); // > 0
     494            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0); // > 0
    489495            il.Emit(System.Reflection.Emit.OpCodes.Cgt);
    490496            il.Emit(System.Reflection.Emit.OpCodes.Conv_R8); // convert to float64
     
    498504        case OpCodes.XOR: {
    499505            CompileInstructions(il, state, ds);
    500             il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
     506            il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0);
    501507            il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
    502508
    503509            for (int i = 1; i < nArgs; i++) {
    504510              CompileInstructions(il, state, ds);
    505               il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4_0);
     511              il.Emit(System.Reflection.Emit.OpCodes.Ldc_R8, 0.0);
    506512              il.Emit(System.Reflection.Emit.OpCodes.Cgt);// > 0
    507513              il.Emit(System.Reflection.Emit.OpCodes.Xor);
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r16565 r16722  
    205205            return Math.Abs(Evaluate(dataset, ref row, state));
    206206          }
     207        case OpCodes.Tanh: {
     208            return Math.Tanh(Evaluate(dataset, ref row, state));
     209          }
    207210        case OpCodes.Cos: {
    208211            return Math.Cos(Evaluate(dataset, ref row, state));
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r16565 r16722  
    226226        } else if (instr.opCode == OpCodes.Absolute) {
    227227          instr.value = Math.Abs(code[instr.childIndex].value);
     228        } else if (instr.opCode == OpCodes.Tanh) {
     229          instr.value = Math.Tanh(code[instr.childIndex].value);
    228230        } else if (instr.opCode == OpCodes.Cos) {
    229231          instr.value = Math.Cos(code[instr.childIndex].value);
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame

    r16565 r16722  
    4242  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
    4343  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    44   [PluginDependency("HeuristicLab.Persistence", "3.3")]
     44  [PluginDependency("HeuristicLab.Attic", "1.0")]
    4545  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4646  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
    4747  [PluginDependency("HeuristicLab.Random", "3.3")]
     48  [PluginDependency("HeuristicLab.Selection", "3.3")]
    4849  public class HeuristicLabProblemsDataAnalysisSymbolicPlugin : PluginBase {
    4950  }
  • branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Selectors/DiversitySelector.cs

    r16623 r16722  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    2422using HEAL.Attic;
    2523using HeuristicLab.Common;
     
    3028using HeuristicLab.Parameters;
    3129using HeuristicLab.Selection;
     30using System;
     31using System.Collections.Generic;
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
Note: See TracChangeset for help on using the changeset viewer.