Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/10/22 10:15:25 (2 years ago)
Author:
dpiringe
Message:

#3138

  • merged trunk into branch
Location:
branches/3138_Shape_Constraints_Transformations
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/3138_Shape_Constraints_Transformations

  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests

  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicClassificationSampleTest.cs

    r17180 r18180  
    109109      varSymbol.WeightManipulatorSigma = 0.05;
    110110      varSymbol.MultiplicativeWeightManipulatorSigma = 0.03;
    111       var constSymbol = grammar.Symbols.OfType<Constant>().Single();
    112       constSymbol.MaxValue = 20;
    113       constSymbol.MinValue = -20;
    114       constSymbol.ManipulatorMu = 0.0;
    115       constSymbol.ManipulatorSigma = 1;
    116       constSymbol.MultiplicativeManipulatorSigma = 0.03;
     111      var numSymbol = grammar.Symbols.OfType<Number>().Single();
     112      numSymbol.MaxValue = 20;
     113      numSymbol.MinValue = -20;
     114      numSymbol.ManipulatorMu = 0.0;
     115      numSymbol.ManipulatorSigma = 1;
     116      numSymbol.MultiplicativeManipulatorSigma = 0.03;
    117117      symbClassProblem.SymbolicExpressionTreeGrammar = grammar;
    118118
  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleTest.cs

    r17180 r18180  
    110110      varSymbol.WeightManipulatorSigma = 0.05;
    111111      varSymbol.MultiplicativeWeightManipulatorSigma = 0.03;
    112       var constSymbol = grammar.Symbols.OfType<Constant>().Single();
    113       constSymbol.MaxValue = 20;
    114       constSymbol.MinValue = -20;
    115       constSymbol.ManipulatorMu = 0.0;
    116       constSymbol.ManipulatorSigma = 1;
    117       constSymbol.MultiplicativeManipulatorSigma = 0.03;
     112      var numSymbol = grammar.Symbols.OfType<Number>().Single();
     113      numSymbol.MaxValue = 20;
     114      numSymbol.MinValue = -20;
     115      numSymbol.ManipulatorMu = 0.0;
     116      numSymbol.ManipulatorSigma = 1;
     117      numSymbol.MultiplicativeManipulatorSigma = 0.03;
    118118      symbRegProblem.SymbolicExpressionTreeGrammar = grammar;
    119119
  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPSymbolicRegressionSampleWithOSTest.cs

    r17948 r18180  
    6666        // Unfortunately, running the same test on a different machine results in different values
    6767        // For x86 environments the results below match but on x64 there is a difference
    68         // We tracked down the ConstantOptimizationEvaluator as a possible cause but have not
     68        // We tracked down the ParameterOptimizationEvaluator as a possible cause but have not
    6969        // been able to identify the real cause. Presumably, execution on a Xeon and a Core i7 processor
    7070        // leads to different results.
     
    184184      problem.MaximumFunctionArguments.Value = 0;
    185185
    186       var evaluator = new SymbolicRegressionConstantOptimizationEvaluator();
    187       evaluator.ConstantOptimizationIterations.Value = 5;
     186      var evaluator = new SymbolicRegressionParameterOptimizationEvaluator();
     187      evaluator.ParameterOptimizationIterations.Value = 5;
    188188      problem.EvaluatorParameter.Value = evaluator;
    189189      problem.RelativeNumberOfEvaluatedSamplesParameter.Hidden = true;
  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GeSymbolicRegressionSampleTest.cs

    r17180 r18180  
    113113        problem.SymbolicExpressionTreeGrammar.RemoveSymbol(c);
    114114      }
     115      var numbers = problem.SymbolicExpressionTreeGrammar.AllowedSymbols.OfType<Number>().ToList();
     116      foreach (var n in numbers) {
     117        problem.SymbolicExpressionTreeGrammar.RemoveSymbol(n);
     118      }
    115119
    116120      SamplesUtils.ConfigureOsGeneticAlgorithmParameters<GenderSpecificSelector, Encodings.IntegerVectorEncoding.SinglePointCrossover, Encodings.IntegerVectorEncoding.UniformOnePositionManipulator>(
  • branches/3138_Shape_Constraints_Transformations/HeuristicLab.Tests/HeuristicLab-3.3/Samples/ShapeConstrainedRegressionSampleTest.cs

    r17968 r18180  
    3535  [TestClass]
    3636  public class ShapeConstrainedRegressionSampleTest {
    37     private const string SampleFileName = "GA_Shape_Constrained_Regression";
     37    private const string SampleFileName = "GP_Shape_Constrained_Regression";
    3838    private static readonly ProtoBufSerializer serializer = new ProtoBufSerializer();
    3939
     
    4747
    4848      if (Environment.Is64BitProcess) {
    49         Assert.AreEqual(0.355347729912352, SamplesUtils.GetDoubleResult(ga, "BestQuality"), 1E-8);
    50         Assert.AreEqual(27.6606834433137, SamplesUtils.GetDoubleResult(ga, "CurrentAverageQuality"), 1E-8);
    51         Assert.AreEqual(3359.91748220025, SamplesUtils.GetDoubleResult(ga, "CurrentWorstQuality"), 1E-8);
     49        Assert.AreEqual(0.035536903914644882, SamplesUtils.GetDoubleResult(ga, "BestQuality"), 1E-8);
     50        Assert.AreEqual(26.707437555596698, SamplesUtils.GetDoubleResult(ga, "CurrentAverageQuality"), 1E-8);
     51        Assert.AreEqual(3294.1754151628993, SamplesUtils.GetDoubleResult(ga, "CurrentWorstQuality"), 1E-8);
    5252        Assert.AreEqual(150200, SamplesUtils.GetIntResult(ga, "EvaluatedSolutions"));
    5353      } else {
     
    5757        Assert.AreEqual(150200, SamplesUtils.GetIntResult(ga, "EvaluatedSolutions"));
    5858      }
     59    }
     60
     61    [TestMethod]
     62    [TestCategory("Samples.Create")]
     63    [TestProperty("Time", "medium")]
     64    public void CreateShapeConstrainedRegressionSampleTest() {
     65      var ga = CreateShapeConstrainedRegressionSample();
     66      string path = Path.Combine(SamplesUtils.SamplesDirectory, SampleFileName + SamplesUtils.SampleFileExtension);
     67      serializer.Serialize(ga, path);
    5968    }
    6069
     
    8291
    8392      #region Algorithm Configuration
    84       alg.Name = "Genetic Programming - Shape constrained Regression";
     93      alg.Name = "Genetic Programming - Shape-constrained Regression";
    8594      alg.Description = "A standard genetic programming algorithm to solve a shape constrained regression problem (Radiated gravitational wave power - Feynman instance)";
    8695      alg.Problem = problem;
     
    93102
    94103      alg.Engine = new ParallelEngine.ParallelEngine();
     104
    95105      return alg;
    96106    }
Note: See TracChangeset for help on using the changeset viewer.