heal-research / HeuristicLab

HeuristicLab - An environment for heuristic and evolutionary optimization
https://dev.heuristiclab.com
GNU General Public License v3.0
39 stars 16 forks source link

Vector-based GP #3040

Open HeuristicLab-Trac-Bot opened 4 years ago

HeuristicLab-Trac-Bot commented 4 years ago

Issue migrated from trac ticket # 3040

component: Problems.DataAnalysis.Symbolic | priority: medium

2019-11-21 13:20:22: @NimZwei created the issue


This ticket will track the overall development of implementing Vector-based GP for Time-Series Regression and Classification.

The main idea is supporting vectors as a new "datatype" in symbolic expression trees along regular numerical values. Additionally, new operators will be developed to work with those vectors to combine them with the existing numerical values.

Because developing the required features will likely involve implementing several components simultaneously, along with some changes within the core DataAnalysis plugins, there will be a main branch in which development will take place, with some trunk-reintegration branches to get completed features back into the trunk.

HeuristicLab-Trac-Bot commented 4 years ago

2019-11-21 13:25:11: @NimZwei changed status from new to accepted

HeuristicLab-Trac-Bot commented 4 years ago

2019-11-21 13:25:11: @NimZwei commented


r17362 Branched trunk

HeuristicLab-Trac-Bot commented 4 years ago

2019-11-22 10:07:17: @NimZwei commented


r17364

  • Added double vectors for Dataset. Extended the type-checks for DataAnalysisProblemData.
  • Added a small benchmark instance with data containing vectors. Adapted the ArtificialRegressionDataDescriptor to be able to specify non-double values.

Additional thoughts:

  • Consider ModifiableDataset and DataPreprocessing.
  • Consider adding generic vector capabilities to IDataset that only allows double, string, DateTime.
  • Consider changing IList within the Dataset to a covariant alternative (non-generic IReadOnlyList does not exist, however). Currently the type must be exactly IReadOnlyList<double>, otherwise the invariant IList<T> is not a subtype of IList<IList<double>> for instance.
  • Each DataAnalysis algorithm should check on it's own, whether the types of the allowed input variables is compatible. For instance, the LR would only allow double-values, whereas SymReg also supports string-variables (as factor variables) and double-vector-variables.
HeuristicLab-Trac-Bot commented 4 years ago

2019-11-22 10:07:17: @NimZwei

HeuristicLab-Trac-Bot commented 4 years ago

2019-11-22 13:26:32: @NimZwei commented


r17365 Added explicit vector types to avoid type-missmatches when representing vectors as IList, List or IReadOnlyList.

Additional toughts:

  • The IDataset interface (and its implementation) now contains a lot of methods due to all the different available types (double, string, DateTime and also vector-versions). In the future, this should be unified.
  • Whether the types of the input variables are allowed should be decided by the algorithms, rather than the ProblemData.
HeuristicLab-Trac-Bot commented 4 years ago

2019-11-25 12:04:40: @NimZwei commented


r17369 Added Vector symbols to TypeCoherentExpressionGrammar & fixes.

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-14 13:19:17: @NimZwei commented


r17400 Added Azzali benchmarks

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-16 12:35:03: @NimZwei commented


r17401 Added parser for new benchmark data but did not commit the data yet (too large)

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-16 15:48:49: @NimZwei commented


r17403 Added fix for non-numeric class labels

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-31 12:43:00: @NimZwei commented


r17414 Started adding UCI time series regression benchmarks. Adapted parser (extracted format options & added parsing for double vectors).

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-31 15:25:27: @NimZwei commented


r17415 Added additional UCI instances for time series regression

HeuristicLab-Trac-Bot commented 4 years ago

2020-01-31 16:21:10: @NimZwei commented


r17416 enabled variable impacts for vectorial data (if vectors have the same length)

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-03 17:25:52: @NimZwei commented


r17418

  • (partially) enabled data preprocessing for vectorial data
  • use flat zip-files for large benchmarks instead of embedded resources (faster build times)
  • added multiple variants of vector benchmark I (vector lenght constraints)
HeuristicLab-Trac-Bot commented 4 years ago

2020-02-03 17:27:10: @NimZwei commented


r17419 added missing source file

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-24 13:09:38: @NimZwei commented


r17447 Added TransportPlugin for MathNet.Numerics.

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-25 07:43:53: @NimZwei commented


r17448 Replaced own Vector with MathNet.Numerics Vector.

  • Used types are not yet storable.
  • I do not like the using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; directive. Maybe Ill switch to using MathNet.Numerics.LinearAlgebra.Single; and only use Vector as type.
HeuristicLab-Trac-Bot commented 4 years ago

2020-02-25 15:33:36: @NimZwei commented


r17449 Added Transformers for Vectors. Added specialiced Transformers for double Dense/SparseVectorStorage and a generic mapper for the remaining (serializable) types.

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-26 09:32:46: @NimZwei commented


r17452 Improved Persistence for Vectors (removed the generic transformer and used the existing array transformer instead).

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-28 10:32:06: @NimZwei commented


r17455 Added separate Interpreter for vector that reuse the existing symbols instead of creating explicit vector symbols.

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-28 10:43:59: @NimZwei commented


r17456 Merged trunk to branch

HeuristicLab-Trac-Bot commented 4 years ago

2020-02-28 14:56:06: @NimZwei commented


r17460

  • Added full functional grammar for vectors.
  • Added sum and mean aggregation for vectors.
HeuristicLab-Trac-Bot commented 4 years ago

2020-03-02 15:04:56: @NimZwei commented


r17463 Added type coherent vector grammar to enforce that the root symbol is a scalar.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-02 16:35:48: @NimZwei commented


r17465 Simplified default vector grammar.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-03 08:32:20: @NimZwei commented


r17466 Added separate mean symbol instead of reusing the average symbol.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-03 12:01:07: @NimZwei commented


r17467 Added a "final aggregation" option for the vector interpreter in case the result is a vector.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-05 12:53:35: @NimZwei commented


r17469 Added TensorFlow.NET library for constant optimization with vectors (as alternative to AutoDiff+Alglib).

The build process for TensorFlow.NET is somewhat tedious for multiple reasons:

  • First, the NumSharp dependency for TensorFlow.NET is not strongly named, thus cannot be loaded with HL.
  • The native tensorflow.dll does not ship correctly with the Framework edition (on dotnet core it works).
  • A newer version of Google.Protobuf is required.

Due to the reasons above, the following steps were taken to import TensorFlow.NET:

  1. All dependencies for Google.Protobuf are upgraded to 3.11.4. This includes HEAL.Attic, which is manually built and then replaces the binaries in the bin. A manual build of HEAL.Attic is currently required anyway, because the BoxTransformer is still internal in the latest Nuget release but already fixed in the Master branch.
  2. Since the OR-Tools (for exact optimization) includes already built assemblies referencing the old Google.Protobuf version, they are currently excluded. Also I removed the HeuristicLab.ProtobufCS-2.4.1 version to avoid any further conflicts. Therefore, external evaluation and some other plugins do not work on this branch.
  3. Although TensorFlow.NET is strongly named, it's dependency NumSharp is not. Simply signing NumSharp did not work, because the reference from TensorFlow.NET expects an unsigned NumSharp assembly. As a solution, there is a standalone project within the Extlibs (TensorFlowNet) that references the Nuget package for TensorFlow.NET and uses ILMerge (also via Nuget package) to create a single assembly, containing both TensorFlow.NET.dll and the NumSharp.dll, and signed with the HL key. The resulting TensorFlow.NET.signed.dll is (file-) referenced within the transport plugin HeuristicLab.TensorFlowNet.
  4. The native tensorflow.dll is located within a separate nuget redist package. However, this does not work for dotnet framework for some reason. I created a dotnet core project with the redist package referenced, and copied the native x64 dll from there into the HeuristicLab.TensorFlowNet transport plugin as native dll plugin dependency.

As a final note: The whole build process is instable. Sometimes the resulting TensorFlow.Signed.dll contains some unloadble types. Clearing the bin folder, praying to ILMerge and the build gods usually helps.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-10 08:28:58: @NimZwei commented


r17472 Moved Alglib+AutoDiff constant optimizer in own class and created base class to provide multiple constant-opt implementations.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-11 15:02:48: @NimZwei commented


r17474 Started working on the TF constant opt evaluator.

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-11 16:19:34: @NimZwei commented


r17475 Updated HeuristicLab.Algorithms.DataAnalysis plugin and its dependencies to Framework 4.7.2 to avoid conflicting System.ValueTuple locations (mscorelib or nuget).

HeuristicLab-Trac-Bot commented 4 years ago

2020-03-12 17:51:49: @NimZwei commented


r17476 Worked on TF-based constant optimization.

HeuristicLab-Trac-Bot commented 4 years ago

2020-04-01 15:49:24: @NimZwei commented


r17489 Added version with explicit array shapes for explicit broadcasting.

HeuristicLab-Trac-Bot commented 4 years ago

2020-04-02 13:13:46: @NimZwei commented


r17493 Write optimized constants back to tree.

HeuristicLab-Trac-Bot commented 4 years ago

2020-04-02 13:13:46: @NimZwei

HeuristicLab-Trac-Bot commented 4 years ago

2020-04-09 14:01:32: @NimZwei commented


r17502

  • Switched whole TF-graph to float (Adam optimizer won't work with double).
  • Added progress and cancellation support for TF-const opt.
  • Added optional logging with console and/or file for later plotting.
HeuristicLab-Trac-Bot commented 4 years ago

2020-05-14 12:25:33: @NimZwei commented


r17541 Added a new benchmark instance.

HeuristicLab-Trac-Bot commented 4 years ago

2020-05-25 14:52:51: @NimZwei commented


r17554 Added some symbols for statistical aggregation.

HeuristicLab-Trac-Bot commented 4 years ago

2020-05-25 16:12:01: @NimZwei commented


r17556 Some corner cases for empty or length-one vectors now return NaN.

HeuristicLab-Trac-Bot commented 4 years ago

2020-05-29 12:53:24: @NimZwei commented


r17573 Added first draft for WindowedSymbol.

ToDo:

  • Make other aggregation symbols windowed
  • Better encoding for Offset and Length parameter
    • Continuous interpretation (e.g. weighted sum/mean)
    • Mutation is currently not symmetric (due to cast/floor mechanic when calculating the actual indices)
  • Create a test function specifically for benchmarking windowed symbols
  • Evaluate alternative: explicit "SubVector" symbol?
    • No continuous interetation
    • Potential issues with incompatible vector lengths
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-05 14:48:14: @NimZwei commented


r17588

  • Adapted existing benchmarks (no mean/sum of vectors with zero-mean).
  • Added new benchmark for testing windowed aggregations.
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-10 11:31:58: @NimZwei commented


r17593 Added a new simplifier that can also simplify vector-specific operators.

  • Added simplification rules for sum-symbol and mean-symbol for addition and multiplication
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-10 13:47:15: @NimZwei commented


r17596: added subtraction/division simplification for sum and mean symbols by converting them to sums/products.

HeuristicLab-Trac-Bot commented 4 years ago

2020-06-10 17:17:57: @NimZwei commented


r17597: Added simplification rules for length-aggregation.

HeuristicLab-Trac-Bot commented 4 years ago

2020-06-16 11:21:50: @NimZwei commented


r17602

  • Changed stddev, variance, etc. to population variant
  • Added multiplicative simplifications for stdev and variance symbols
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-16 13:38:11: @NimZwei commented


r17603

  • Added additive simplification rules for stdev and variance symbols.
  • Extended simplifications of constants to simplification of all scalar-nodes for aggregation symbols.
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-17 11:23:46: @NimZwei commented


r17604 Stores the datatype of a tree node (e.g. variable nodes) in the tree itself for the interpreter to derive the datatypes for subtrees. This way, the interpreter (and simplifier) do not need an actual dataset to figure out datatypes for subtrees.

HeuristicLab-Trac-Bot commented 4 years ago

2020-06-17 16:19:08: @NimZwei commented


r17605 Adapted unit test for trunk changes.

HeuristicLab-Trac-Bot commented 4 years ago

2020-06-17 16:22:28: @NimZwei commented


r17606

  • Extended importer (vectorvariable, vec-aggregations, ...).
  • Started adding unit test for vector simplifications.
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-22 13:48:53: @NimZwei commented


r17622 Added vector variables to infix parser/formatter.

HeuristicLab-Trac-Bot commented 4 years ago

2020-06-22 14:56:02: @NimZwei commented


r17624

  • Switched vector-simplification unit-test to infix notation to avoid ambiguities between the peek-string "VAR" for variables and the variance function.
  • Added additional unit tests for mean, length, stdev and var simplifications.
HeuristicLab-Trac-Bot commented 4 years ago

2020-06-23 10:05:28: @NimZwei commented


r17626 Unified simplification rules for vector aggregation functions.