Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15976


Ignore:
Timestamp:
06/29/18 09:07:03 (6 years ago)
Author:
jkarder
Message:

#2745: worked on EGO implementation

  • added parameter for initial sample set (only for D-EGO)
  • fixed project references and output paths
  • minor changes
Location:
branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteAdaptiveSamplingAlgorithm.cs

    r15343 r15976  
    4040    private const string RemoveDuplicatesParamterName = "PerturbDuplicates";
    4141    private const string MaxModelSizeParameterName = "Maximal Model Size";
     42    private const string InitialDatasetParameterName = "SampleSet";
    4243    #endregion
    4344
     
    5354    public IFixedValueParameter<BoolValue> RemoveDuplicatesParameter => (IFixedValueParameter<BoolValue>)Parameters[RemoveDuplicatesParamterName];
    5455    public IFixedValueParameter<IntValue> MaxModelSizeParameter => (IFixedValueParameter<IntValue>)Parameters[MaxModelSizeParameterName];
     56    public IValueParameter<IDataset> InitialDatasetParameter => (IValueParameter<IDataset>)Parameters[InitialDatasetParameterName];
    5557    #endregion
    5658
     
    6769    public int MaxModelSize => MaxModelSizeParameter.Value.Value;
    6870    private SolutionsCreator SolutionsCreator => OperatorGraph.Iterate().OfType<SolutionsCreator>().First();
     71    public IDataset InitialDataset => InitialDatasetParameter.Value;
    6972    #endregion
    7073
     
    168171      Parameters.Add(new FixedValueParameter<BoolValue>(RemoveDuplicatesParamterName, "Whether (almost) duplicate points in the dataset should be perturbed before evaluation (this greatly increases numerical stability for some model types)", new BoolValue(true)));
    169172      Parameters.Add(new FixedValueParameter<IntValue>("Maximal Model Size", "The maximum number of sample points used to build the model", new IntValue(-1)));
     173      Parameters.Add(new ValueParameter<IDataset>(InitialDatasetParameterName, "The initial dataset that should be built upon.", new ModifiableDataset()));
    170174      #endregion
    171175
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs

    r15343 r15976  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using System.Linq;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
     
    5961      if (data.Columns != vector.Length + 1) {
    6062        if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1");
    61         for (var i = 0; i < vector.Length; i++)
    62           data.AddVariable("input" + i, new double[0]);
    63         data.AddVariable("output", new double[0]);
    64       }
    65       AddRow(data, vector, quality);
    66       return base.InstrumentedApply(); ;
     63        var variableNames = vector.Select((x, i) => string.Format("input" + i)).Concat("output".ToEnumerable());
     64        var variableValues = vector.Select(x => (double)x).Concat(quality.ToEnumerable()).Select(x => new List<double> { x });
     65        data = DatasetParameter.ActualValue = new ModifiableDataset(variableNames, variableValues);
     66      } else AddRow(data, vector, quality);
     67
     68      return base.InstrumentedApply();
    6769    }
    6870
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/HeuristicLab.Algorithms.EGO-3.4.csproj

    r15343 r15976  
    1717    <DebugType>full</DebugType>
    1818    <Optimize>false</Optimize>
    19     <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
     19    <OutputPath>..\..\..\trunk\bin\</OutputPath>
    2020    <DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
    2121    <ErrorReport>prompt</ErrorReport>
     
    3333    <Reference Include="HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    3434      <SpecificVersion>False</SpecificVersion>
    35       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4.dll</HintPath>
     35      <HintPath>..\..\..\trunk\bin\HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4.dll</HintPath>
     36      <Private>False</Private>
    3637    </Reference>
    3738    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    3839      <SpecificVersion>False</SpecificVersion>
    39       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
     40      <HintPath>..\..\..\trunk\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
     41      <Private>False</Private>
    4042    </Reference>
    4143    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    4244      <SpecificVersion>False</SpecificVersion>
    43       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
     45      <HintPath>..\..\..\trunk\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
     46      <Private>False</Private>
    4447    </Reference>
    4548    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    4649      <SpecificVersion>False</SpecificVersion>
    47       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     50      <HintPath>..\..\..\trunk\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     51      <Private>False</Private>
    4852    </Reference>
    4953    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    5054      <SpecificVersion>False</SpecificVersion>
    51       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     55      <HintPath>..\..\..\trunk\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     56      <Private>False</Private>
    5257    </Reference>
    5358    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    5459      <SpecificVersion>False</SpecificVersion>
    55       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     60      <HintPath>..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
     61      <Private>False</Private>
    5662    </Reference>
    5763    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    5864      <SpecificVersion>False</SpecificVersion>
    59       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     65      <HintPath>..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     66      <Private>False</Private>
    6067    </Reference>
    6168    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    6269      <SpecificVersion>False</SpecificVersion>
    63       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     70      <HintPath>..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
     71      <Private>False</Private>
    6472    </Reference>
    6573    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    6674      <SpecificVersion>False</SpecificVersion>
    67       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath>
     75      <HintPath>..\..\..\trunk\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath>
     76      <Private>False</Private>
    6877    </Reference>
    6978    <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    7079      <SpecificVersion>False</SpecificVersion>
    71       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath>
     80      <HintPath>..\..\..\trunk\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath>
     81      <Private>False</Private>
    7282    </Reference>
    7383    <Reference Include="HeuristicLab.Encodings.RealVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    7484      <SpecificVersion>False</SpecificVersion>
    75       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
    76     </Reference>
    77     <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec" />
     85      <HintPath>..\..\..\trunk\bin\HeuristicLab.Encodings.RealVectorEncoding-3.3.dll</HintPath>
     86      <Private>False</Private>
     87    </Reference>
     88    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec">
     89      <Private>False</Private>
     90    </Reference>
    7891    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    7992      <SpecificVersion>False</SpecificVersion>
    80       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     93      <HintPath>..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     94      <Private>False</Private>
    8195    </Reference>
    8296    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    8397      <SpecificVersion>False</SpecificVersion>
    84       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     98      <HintPath>..\..\..\trunk\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     99      <Private>False</Private>
    85100    </Reference>
    86101    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    87102      <SpecificVersion>False</SpecificVersion>
    88       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     103      <HintPath>..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     104      <Private>False</Private>
    89105    </Reference>
    90106    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    91107      <SpecificVersion>False</SpecificVersion>
    92       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     108      <HintPath>..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     109      <Private>False</Private>
    93110    </Reference>
    94111    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    95112      <SpecificVersion>False</SpecificVersion>
    96       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     113      <HintPath>..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     114      <Private>False</Private>
    97115    </Reference>
    98116    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    99117      <SpecificVersion>False</SpecificVersion>
    100       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
    101     </Reference>
    102     <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec" />
     118      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
     119      <Private>False</Private>
     120    </Reference>
     121    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec">
     122      <Private>False</Private>
     123    </Reference>
    103124    <Reference Include="HeuristicLab.Problems.SurrogateProblem-3.3, Version=3.3.0.0, Culture=neutral, processorArchitecture=MSIL">
    104125      <SpecificVersion>False</SpecificVersion>
    105       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Problems.SurrogateProblem-3.3.dll</HintPath>
     126      <HintPath>..\..\..\trunk\bin\HeuristicLab.Problems.SurrogateProblem-3.3.dll</HintPath>
    106127    </Reference>
    107128    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    108129      <SpecificVersion>False</SpecificVersion>
    109       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
     130      <HintPath>..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
     131      <Private>False</Private>
    110132    </Reference>
    111133    <Reference Include="Microsoft.Build.Tasks.v4.0" />
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/FitnessClusteringAnalyzer.cs

    r15338 r15976  
    8686    private ScatterPlot CreateTSNEPlot(KMeansClusteringSolution clustering, ModifiableDataset data, IRandom random) {
    8787      var clusteredData = (ModifiableDataset)data.Clone();
    88       clusteredData.AddVariable("cluster", clustering.ClusterValues.Select(x => (double)x));
     88      clusteredData.AddVariable("cluster", clustering.ClusterValues.Select(x => (double)x).ToList());
    8989
    9090      var prob = new RegressionProblem {
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/SampleCollector.cs

    r15343 r15976  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using System.Linq;
    2224using HeuristicLab.Common;
    2325using HeuristicLab.Core;
     
    5860      if (data.Columns != vector.Length + 1) {
    5961        if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1");
    60         for (var i = 0; i < vector.Length; i++)
    61           data.AddVariable("input" + i, new double[0]);
    62         data.AddVariable("output", new double[0]);
     62        data = new ModifiableDataset(
     63          Enumerable.Range(0, vector.Length).Select(x => "input" + x).Concat(new[] { "output" }),
     64          Enumerable.Range(0, vector.Length + 1).Select(x => new List<double>()));
     65        DatasetParameter.ActualValue = data;
    6366      }
    6467      AddRow(data, vector, quality);
    65       return base.InstrumentedApply(); ;
     68      return base.InstrumentedApply();
    6669    }
    6770
  • branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Plugin.cs.frame

    r15064 r15976  
    3030  [PluginDependency("HeuristicLab.Algorithms.CMAEvolutionStrategy", "3.4")]
    3131  [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")]
     32  [PluginDependency("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3")]
    3233  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3334  [PluginDependency("HeuristicLab.Collections", "3.3")]
     
    3536  [PluginDependency("HeuristicLab.Core", "3.3")]
    3637  [PluginDependency("HeuristicLab.Data", "3.3")]
     38  [PluginDependency("HeuristicLab.Encodings.IntegerVectorEncoding", "3.3")]
    3739  [PluginDependency("HeuristicLab.Encodings.RealVectorEncoding", "3.3")]
    3840  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
     
    4547  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
    4648  [PluginDependency("HeuristicLab.Random", "3.3")]
    47   public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase {
     49  public class HeuristicLabAlgorithmsEGOPlugin : PluginBase {
    4850  }
    4951}
Note: See TracChangeset for help on using the changeset viewer.