Free cookie consent management tool by TermsFeed Policy Generator

# Changeset 17588

Ignore:
Timestamp:
06/05/20 14:47:55 (4 years ago)
Message:
• Adapted existing benchmarks (no mean/sum of vectors with zero-mean).
• Added new benchmark for testing windowed aggregations.
Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3
Files:
6 edited
1 copied

Unmodified
Removed
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj

 r17541
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/AzzaliBenchmark3.cs

 r17448 namespace HeuristicLab.Problems.Instances.DataAnalysis { public class AzzaliBenchmark3 : ArtificialRegressionDataDescriptor { public override string Name { get { return "Azzali Benchmark2 B3 = CumMin[3,3] * (X2 / X3) + X4"; } } public override string Name { get { return "Azzali Benchmark3 B3 = CumMin[3,3] * (X2 / X3) + X4"; } } public override string Description { get { return "I. Azzali, L. Vanneschi, S. Silva, I. Bakurov, and M. Giacobini, “A Vectorial Approach to Genetic Programming,” EuroGP, pp. 213–227, 2019."; } }
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/RandomExtensions.cs

 r17448 return DoubleVector.Build.Dense(values); } public static DoubleVector NextIncreasingDoubleVector(this IRandom rand, double min, double max, int length) { var values = new double[length]; for (int i = 0; i < values.Length; i++) { double offset = i * rand.NextDouble(); values[i] = rand.NextDouble(min, max) + offset; } return DoubleVector.Build.Dense(values); } } }
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VectorDataInstanceProvider.cs

 r17541 //new VectorDataTestTwoC(rand.Next()), //new VectorDataTestTwoD(rand.Next()), new VectorDataTestThreeA(rand.Next()), new VectorDataTestThreeB(rand.Next()), new VectorDataTestThreeC(rand.Next()), new VectorDataTestThreeD(rand.Next()), new AzzaliBenchmark1(rand.Next()), new AzzaliBenchmark2(rand.Next()),
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VectorDataTestOne.cs

 r17541 using HeuristicLab.Random; using MathNet.Numerics.Statistics; using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector; public abstract class VectorDataTestOne : ArtificialRegressionDataDescriptor { protected const int Rows = 100; protected const int Rows = 1000; public override string Description { get { return ""; } } int v1Length = vectorLengths[0][i]; int v2Length = vectorLengths[1][i]; v1 = rand.NextDoubleVector(-2, 2, v1Length); v1 = rand.NextDoubleVector(2, 6, v1Length); v2 = rand.NextDoubleVector(3, 5, v2Length);
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VectorDataTestThree.cs

 r17554 using HeuristicLab.Random; using MathNet.Numerics.Statistics; using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector; namespace HeuristicLab.Problems.Instances.DataAnalysis { public abstract class VectorDataTestTwo : ArtificialRegressionDataDescriptor { public abstract class VectorDataTestThree : ArtificialRegressionDataDescriptor { protected const int Rows = 1000; public int Seed { get; private set; } protected VectorDataTestTwo() protected VectorDataTestThree() : this((int)DateTime.Now.Ticks) { } protected VectorDataTestTwo(int seed) protected VectorDataTestThree(int seed) : base() { Seed = seed; int v1Length = vectorLengths[0][i]; int v2Length = vectorLengths[1][i]; v1 = rand.NextDoubleVector(-2, 2, v1Length); v2 = rand.NextDoubleVector(3, 5, v2Length); v1 = rand.NextIncreasingDoubleVector(1, 4, v1Length); v2 = rand.NextIncreasingDoubleVector(3, 5, v2Length); y = x1 * v1.PointwiseExp().PointwiseMultiply(v2 + x2).Sum(); //Y = (X1 + sum[2:](V1)) * mean[:-2](V2 + X2) y = (x1 + v1.SubVector(2, v1.Count - 2).Sum() ) * (v2 + x2).SubVector(0, v2.Count - 2).Mean(); x1Column.Add(x1); } public class VectorDataTestTwoA : VectorDataTestTwo { public class VectorDataTestThreeA : VectorDataTestThree { public override string Name { get { return "Vector Data Test - II [fully-constrained]: Y = X1 * sum(exp(V1) * (V2 + X2))"; } get { return "Vector Data Test - III [fully-constrained]: Y = (X1 + sum[2:](V1)) * mean[:-2](V2 + X2)"; } } public VectorDataTestTwoA() : base() { } public VectorDataTestTwoA(int seed) : base(seed) { } public VectorDataTestThreeA() : base() { } public VectorDataTestThreeA(int seed) : base(seed) { } protected override List[] GetVectorLengths(IRandom rand) { // always same length const int length = 5; const int length = 8; return new List[2] { Enumerable.Repeat(length, Rows).ToList(), } public class VectorDataTestTwoB : VectorDataTestTwo { public override string Name { get { return "Vector Data Test - II [row-constrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } public class VectorDataTestThreeB : VectorDataTestThree { public override string Name { get { return "Vector Data Test - III [row-constrained]: Y = (X1 + sum[2:](V1)) * mean[:-2](V2 + X2)"; } } public VectorDataTestTwoB() : base() { } public VectorDataTestTwoB(int seed) : base(seed) { } public VectorDataTestThreeB() : base() { } public VectorDataTestThreeB(int seed) : base(seed) { } protected override List[] GetVectorLengths(IRandom rand) { // length between length 4 and 8, same row always the same length var lengths = Enumerable.Range(0, Rows).Select(i => rand.Next(4, 8)).ToList(); // length between length 6 and 10, same row always the same length var lengths = Enumerable.Range(0, Rows).Select(i => rand.Next(6, 10)).ToList(); return new List[2] { Enumerable.Range(0, Rows).Select(i => lengths[i]).ToList(), } //public class VectorDataTestTwoC : VectorDataTestTwo { //  public override string Name { get { return "Vector Data Test - II [column-constrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } public class VectorDataTestThreeC : VectorDataTestThree { public override string Name { get { return "Vector Data Test - III [column-constrained]: Y = (X1 + sum[2:](V1)) * mean[:-2](V2 + X2)"; } } //  public VectorDataTestTwoC() : base() { } //  public VectorDataTestTwoC(int seed) : base(seed) { } public VectorDataTestThreeC() : base() { } public VectorDataTestThreeC(int seed) : base(seed) { } //  protected override List[] GetVectorLengths(IRandom rand) { //    // length between length 4 and 8; each feature is same length //    // force two different lengths //    int v1Length = rand.Next(4, 8); //    int v2Length; //    do { //      v2Length = rand.Next(4, 8); //    } while (v1Length != v2Length); //    return new List[2] { //      Enumerable.Repeat(v1Length, Rows).ToList(), //      Enumerable.Repeat(v2Length, Rows).ToList() //    }; //  } //} protected override List[] GetVectorLengths(IRandom rand) { // length between length 6 and 10; each feature is same length // force two different lengths int v1Length = rand.Next(6, 10); int v2Length; do { v2Length = rand.Next(6, 10); } while (v1Length != v2Length); return new List[2] { Enumerable.Repeat(v1Length, Rows).ToList(), Enumerable.Repeat(v2Length, Rows).ToList() }; } } //public class VectorDataTestTwoD : VectorDataTestTwo { //  public override string Name { get { return "Vector Data Test - II [unconstrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } public class VectorDataTestThreeD : VectorDataTestThree { public override string Name { get { return "Vector Data Test - III [unconstrained]: Y = (X1 + sum[2:](V1)) * mean[:-2](V2 + X2)"; } } //  public VectorDataTestTwoD() : base() { } //  public VectorDataTestTwoD(int seed) : base(seed) { } public VectorDataTestThreeD() : base() { } public VectorDataTestThreeD(int seed) : base(seed) { } //  protected override List[] GetVectorLengths(IRandom rand) { //    // always random between 4 and 8 //    return new List[2] { //        Enumerable.Range(0, Rows).Select(i => rand.Next(4, 8)).ToList(), //        Enumerable.Range(0, Rows).Select(i => rand.Next(4, 8)).ToList() //      }; //  } //} protected override List[] GetVectorLengths(IRandom rand) { // always random between 6 and 10 return new List[2] { Enumerable.Range(0, Rows).Select(i => rand.Next(6, 10)).ToList(), Enumerable.Range(0, Rows).Select(i => rand.Next(6, 10)).ToList() }; } } }
• ## branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VectorDataTestTwo.cs

 r17554 using HeuristicLab.Core; using HeuristicLab.Random; using MathNet.Numerics.Statistics; using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector; for (int i = 0; i < Rows; i++) { x1 = rand.NextDouble(-2, 2); x2 = rand.NextDouble(2, 6); x2 = rand.NextDouble(4, 6); x3 = rand.NextDouble(0, 1); int v1Length = vectorLengths[0][i]; int v2Length = vectorLengths[1][i]; v1 = rand.NextDoubleVector(-2, 2, v1Length); v2 = rand.NextDoubleVector(3, 5, v2Length); v2 = rand.NextDoubleVector(2, 4, v2Length); y = x1 * v1.PointwiseExp().PointwiseMultiply(v2 + x2).Sum(); y = x1 * v1.PointwiseExp().PointwiseMultiply(x2  - v2 - 2).Sum(); x1Column.Add(x1); public class VectorDataTestTwoA : VectorDataTestTwo { public override string Name { get { return "Vector Data Test - II [fully-constrained]: Y = X1 * sum(exp(V1) * (V2 + X2))"; } get { return "Vector Data Test - II [fully-constrained]: Y = X1 * sum(exp(V1) * (X2 - V2 - 2))"; } } public class VectorDataTestTwoB : VectorDataTestTwo { public override string Name { get { return "Vector Data Test - II [row-constrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } public override string Name { get { return "Vector Data Test - II [row-constrained]: Y = X1 * sum(exp(V1) * (X2 - V2 - 2))"; } } public VectorDataTestTwoB() : base() { } //public class VectorDataTestTwoC : VectorDataTestTwo { //  public override string Name { get { return "Vector Data Test - II [column-constrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } //  public override string Name { get { return "Vector Data Test - II [column-constrained]: Y = X1 * sum(exp(V1) * (X2 - V2 - 2))"; } } //  public VectorDataTestTwoC() : base() { } //public class VectorDataTestTwoD : VectorDataTestTwo { //  public override string Name { get { return "Vector Data Test - II [unconstrained]: Y = X1 * mean(exp(V1) + X2 * V2)"; } } //  public override string Name { get { return "Vector Data Test - II [unconstrained]: Y = X1 * sum(exp(V1) * (X2 - V2 - 2))"; } } //  public VectorDataTestTwoD() : base() { }
Note: See TracChangeset for help on using the changeset viewer.