Giter Site home page Giter Site logo

heal-research / operon Goto Github PK

View Code? Open in Web Editor NEW
127.0 10.0 25.0 21.95 MB

C++ Large Scale Genetic Programming

Home Page: https://operongp.readthedocs.io

License: MIT License

CMake 4.10% C++ 95.32% Nix 0.39% Python 0.20%
genetic-programming symbolic-regression cpp17 cpp genetic-algorithm cmake python mathematical-expressions python-bindings vcpkg

operon's Introduction


Modern C++ framework for Symbolic Regression

License build-linux build-macos build-windows Documentation Status Matrix Channel

Operon is a modern C++ framework for symbolic regression that uses genetic programming to explore a hypothesis space of possible mathematical expressions in order to find the best-fitting model for a given regression target. Its main purpose is to help develop accurate and interpretable white-box models in the area of system identification. More in-depth documentation available at https://operongp.readthedocs.io/.

How does it work?

Broadly speaking, genetic programming (GP) is said to evolve a population of "computer programs" ― AST-like structures encoding behavior for a given problem domain ― following the principles of natural selection. It repeatedly combines random program parts keeping only the best results ― the "fittest". Here, the biological concept of fitness is defined as a measure of a program's ability to solve a certain task.

In symbolic regression, the programs represent mathematical expressions typically encoded as expression trees. Fitness is usually defined as goodness of fit between the dependent variable and the prediction of a tree-encoded model. Iterative selection of best-scoring models followed by random recombination leads naturally to a self-improving process that is able to uncover patterns in the data:

Build instructions

The project requires CMake and a C++17 compliant compiler (C++20 if you're on the cpp20 branch). The recommended way to build Operon is via either nix or vcpkg.

Check out https://github.com/heal-research/operon/blob/master/BUILDING.md for detailed build instructions and how to enable/disable certain features.

Nix

First, you have to install nix and enable flakes. For a portable install, see nix-portable.

To create a development shell:

nix develop github:heal-research/operon --no-write-lock-file

To build Operon (a symlink to the nix store called result will be created).

nix build github:heal-research/operon --no-write-lock-file

Vcpkg

Select the build generator appropriate for your system and point CMake to the vcpkg.cmake toolchain file

cmake -S . -B build -G "Visual Studio 16 2019" -A x64 \
-DCMAKE_TOOLCHAIN_FILE=..\vcpkg\scripts\buildsystems\vcpkg.cmake \
-DVCPKG_OVERLAY_PORTS=.\ports

The file CMakePresets.json contains some presets that you may find useful. For using clang-cl instead of cl, pass -TClangCL to the above (official documentation).

Python wrapper

Python bindings for the Operon library are available as a separate project: PyOperon, which also includes a scikit-learn compatible regressor.

Bibtex info

If you find Operon useful you can cite our work as:

@inproceedings{10.1145/3377929.3398099,
    author = {Burlacu, Bogdan and Kronberger, Gabriel and Kommenda, Michael},
    title = {Operon C++: An Efficient Genetic Programming Framework for Symbolic Regression},
    year = {2020},
    isbn = {9781450371278},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    url = {https://doi.org/10.1145/3377929.3398099},
    doi = {10.1145/3377929.3398099},
    booktitle = {Proceedings of the 2020 Genetic and Evolutionary Computation Conference Companion},
    pages = {1562–1570},
    numpages = {9},
    keywords = {symbolic regression, genetic programming, C++},
    location = {Canc\'{u}n, Mexico},
    series = {GECCO '20}
}

Operon was also featured in a recent survey of symbolic regression methods, where it showed good results:

@article{DBLP:journals/corr/abs-2107-14351,
    author    = {William G. La Cava and
                 Patryk Orzechowski and
                 Bogdan Burlacu and
                 Fabr{\'{\i}}cio Olivetti de Fran{\c{c}}a and
                 Marco Virgolin and
                 Ying Jin and
                 Michael Kommenda and
                 Jason H. Moore},
    title     = {Contemporary Symbolic Regression Methods and their Relative Performance},
    journal   = {CoRR},
    volume    = {abs/2107.14351},
    year      = {2021},
    url       = {https://arxiv.org/abs/2107.14351},
    eprinttype = {arXiv},
    eprint    = {2107.14351},
    timestamp = {Tue, 03 Aug 2021 14:53:34 +0200},
    biburl    = {https://dblp.org/rec/journals/corr/abs-2107-14351.bib},
    bibsource = {dblp computer science bibliography, https://dblp.org}
}

operon's People

Contributors

foolnotion avatar fredmorcos avatar gkronber avatar lacava avatar mkommend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

operon's Issues

TypeError: __init__(): incompatible constructor arguments

the last build of the regression-benchmarks failed on operon: https://github.com/EpistasisLab/regression-benchmark/runs/2339573927

self = SymbolicRegressor(generations=2, pool_size=1000, random_state=42)
error_metric = 'r2', problem = <operon._operon.Problem object at 0x7fd576922130>

    def __init_evaluator(self, error_metric, problem):
        if error_metric == 'r2':
>           return op.RSquaredEvaluator(problem)
E           TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
E               1. operon._operon.RSquaredEvaluator(arg0: Operon::Problem, arg1: Operon::Interpreter)
E           
E           Invoked with: <operon._operon.Problem object at 0x7fd576922130>

/usr/share/miniconda/envs/srbench/lib/python3.9/site-packages/operon/sklearn.py:154: TypeError

Build error: inlining failed in call to always_inline ‘int _mm256_testz_si256(__m256i, __m256i)’: target specific option mismatch

Archlinux testing x86_64, gcc 9.3.

CMake output:

-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.26.2") 
-- Found installed version of Eigen: /usr/share/eigen3/cmake
-- Found required Ceres dependency: Eigen version 3.3.7 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Ceres version 1.14.0 detected here: /usr was built with C++11. Ceres target will add C++11 flags to compile options for targets using it.
-- Found Ceres version: 1.14.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, C++11, OpenMP, Multithreading]
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Python3: /usr/lib/libpython3.8.so (found version "3.8") found components: Development 
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.2") 
-- Found PythonLibs: /usr/lib/libpython3.8.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fred/Workspace/tmp/operon/build

Make output:

Scanning dependencies of target operon
[  3%] Building CXX object CMakeFiles/operon.dir/src/core/metrics.cpp.o
[  7%] Building CXX object CMakeFiles/operon.dir/src/core/tree.cpp.o
[ 11%] Building CXX object CMakeFiles/operon.dir/src/core/problem.cpp.o
/home/fred/Workspace/tmp/operon/src/core/problem.cpp: In member function ‘Operon::Solution Operon::Problem::CreateSolution(const Operon::Tree&) const’:
/home/fred/Workspace/tmp/operon/src/core/problem.cpp:23:46: warning: unused parameter ‘tree’ [-Wunused-parameter]
   23 | Solution Problem::CreateSolution(const Tree& tree) const
      |                                  ~~~~~~~~~~~~^~~~
[ 15%] Building CXX object CMakeFiles/operon.dir/src/core/dataset.cpp.o
[ 19%] Building CXX object CMakeFiles/operon.dir/src/operators/crossover.cpp.o
[ 23%] Building CXX object CMakeFiles/operon.dir/src/operators/mutation.cpp.o
[ 26%] Building CXX object CMakeFiles/operon.dir/src/stat/meanvariance.cpp.o
[ 30%] Building CXX object CMakeFiles/operon.dir/src/stat/pearson.cpp.o
[ 34%] Linking CXX shared library liboperon.so
[ 34%] Built target operon
Scanning dependencies of target pyoperon
[ 38%] Building CXX object CMakeFiles/pyoperon.dir/python/operon.cpp.o
[ 42%] Linking CXX shared library libpyoperon.so
[ 42%] Built target pyoperon
Scanning dependencies of target operon-test
[ 46%] Building CXX object CMakeFiles/operon-test.dir/test/test.cpp.o
[ 50%] Building CXX object CMakeFiles/operon-test.dir/test/performance/evaluation.cpp.o
In file included from /home/fred/Workspace/tmp/operon/test/performance/evaluation.cpp:30:
/usr/include/tbb/task_scheduler_init.h:21:154: note: #pragma message: TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.
   21 | #pragma message("TBB Warning: tbb/task_scheduler_init.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")
      |                                                                                                                                                          ^
In file included from /home/fred/Workspace/tmp/operon/test/performance/evaluation.cpp:25:
/home/fred/Workspace/tmp/operon/include/operon/core/eval.hpp: In instantiation of ‘void Operon::Evaluate(const Operon::Tree&, const Operon::Dataset&, Operon::Range, const T*, gsl::span<ElementType, 18446744073709551615>) [with T = float]’:
/home/fred/Workspace/tmp/operon/include/operon/core/eval.hpp:73:13:   required from ‘Operon::Vector<T> Operon::Evaluate(const Operon::Tree&, const Operon::Dataset&, Operon::Range, const T*) [with T = float; Operon::Vector<T> = std::vector<float, Eigen::aligned_allocator<float> >]’
/home/fred/Workspace/tmp/operon/test/performance/evaluation.cpp:81:136:   required from ‘Operon::Test::____C_A_T_C_H____T_E_S_T____0()::<lambda(int)>::<lambda(const auto:12&)> [with auto:12 = Operon::Tree]’
/usr/include/c++/9.3.0/pstl/unseq_backend_simd.h:33:12:   required from ‘_Iterator __pstl::__unseq_backend::__simd_walk_1(_Iterator, _DifferenceType, _Function) [with _Iterator = __gnu_cxx::__normal_iterator<Operon::Tree*, std::vector<Operon::Tree> >; _DifferenceType = long int; _Function = Operon::Test::____C_A_T_C_H____T_E_S_T____0()::<lambda(int)>::<lambda(const auto:12&)>]’
/usr/include/c++/9.3.0/pstl/algorithm_impl.h:106:35:   required from ‘void __pstl::__internal::__brick_walk1(_RandomAccessIterator, _RandomAccessIterator, _Function, std::true_type) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Operon::Tree*, std::vector<Operon::Tree> >; _Function = Operon::Test::____C_A_T_C_H____T_E_S_T____0()::<lambda(int)>::<lambda(const auto:12&)>; std::true_type = std::integral_constant<bool, true>]’
/usr/include/c++/9.3.0/pstl/algorithm_impl.h:128:68:   required from ‘void __pstl::__internal::__pattern_walk1(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function, _IsVector, std::true_type) [with _ExecutionPolicy = const __pstl::execution::v1::parallel_unsequenced_policy&; _ForwardIterator = __gnu_cxx::__normal_iterator<Operon::Tree*, std::vector<Operon::Tree> >; _Function = Operon::Test::____C_A_T_C_H____T_E_S_T____0()::<lambda(int)>::<lambda(const auto:12&)>; _IsVector = std::integral_constant<bool, true>; std::true_type = std::integral_constant<bool, true>]’
/usr/include/c++/9.3.0/pstl/glue_algorithm_impl.h:62:32:   required from ‘__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::for_each(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Function) [with _ExecutionPolicy = const __pstl::execution::v1::parallel_unsequenced_policy&; _ForwardIterator = __gnu_cxx::__normal_iterator<Operon::Tree*, std::vector<Operon::Tree> >; _Function = Operon::Test::____C_A_T_C_H____T_E_S_T____0()::<lambda(int)>::<lambda(const auto:12&)>; __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> = void]’
/home/fred/Workspace/tmp/operon/test/performance/evaluation.cpp:81:163:   required from here
/home/fred/Workspace/tmp/operon/include/operon/core/eval.hpp:166:54: warning: narrowing conversion of ‘s.Operon::Node::Value’ from ‘const Scalar’ {aka ‘const double’} to ‘float’ [-Wnarrowing]
  166 |                 auto w = parameters == nullptr ? T{s.Value} : parameters[idx++];
      |                                                    ~~^~~~~
/home/fred/Workspace/tmp/operon/include/operon/core/eval.hpp:166:54: warning: narrowing conversion of ‘(Operon::Scalar)s.Operon::Node::Value’ from ‘Operon::Scalar’ {aka ‘double’} to ‘float’ [-Wnarrowing]
[ 53%] Building CXX object CMakeFiles/operon-test.dir/test/performance/initialization.cpp.o
[ 57%] Building CXX object CMakeFiles/operon-test.dir/test/performance/hashing.cpp.o
[ 61%] Building CXX object CMakeFiles/operon-test.dir/test/performance/distance.cpp.o
In file included from /home/fred/Workspace/tmp/operon/test/performance/distance.cpp:25:
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp: In function ‘bool Operon::Distance::{anonymous}::NullIntersectProbe(const Hash*, const Hash*)’:
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp:18:55: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
   18 |             __m256i a{_mm256_load_si256((__m256i*)lhs)};
      |                                                       ^
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp: In function ‘bool Operon::Distance::{anonymous}::_mm256_is_zero(__m256i)’:
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp:14:28: note: the ABI for passing parameters with 32-byte alignment has changed in GCC 4.6
   14 |         static inline bool _mm256_is_zero(__m256i m) noexcept { return _mm256_testz_si256(m, m); }
      |                            ^~~~~~~~~~~~~~
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp: At global scope:
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp:108:23: warning: ‘double Operon::Distance::{anonymous}::SorensenDice(const HashVector&, const HashVector&)’ defined but not used [-Wunused-function]
  108 |         static double SorensenDice(HashVector const& lhs, HashVector const& rhs) noexcept
      |                       ^~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/immintrin.h:51,
                 from /home/fred/Workspace/tmp/operon/thirdparty/xxhash/xxhash.hpp:45,
                 from /home/fred/Workspace/tmp/operon/include/operon/core/common.hpp:27,
                 from /home/fred/Workspace/tmp/operon/include/operon/core/dataset.hpp:23,
                 from /home/fred/Workspace/tmp/operon/test/performance/distance.cpp:20:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/avxintrin.h: In function ‘bool Operon::Distance::{anonymous}::_mm256_is_zero(__m256i)’:
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/avxintrin.h:1171:1: error: inlining failed in call to always_inline ‘int _mm256_testz_si256(__m256i, __m256i)’: target specific option mismatch
 1171 | _mm256_testz_si256 (__m256i __M, __m256i __V)
      | ^~~~~~~~~~~~~~~~~~
In file included from /home/fred/Workspace/tmp/operon/test/performance/distance.cpp:25:
/home/fred/Workspace/tmp/operon/include/operon/core/distance.hpp:14:90: note: called from here
   14 |         static inline bool _mm256_is_zero(__m256i m) noexcept { return _mm256_testz_si256(m, m); }
      |                                                                        ~~~~~~~~~~~~~~~~~~^~~~~~
make[2]: *** [CMakeFiles/operon-test.dir/build.make:135: CMakeFiles/operon-test.dir/test/performance/distance.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:530: CMakeFiles/operon-test.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

getting the build process to recognize a lower python version

I'm trying to get operon to install with Python 3.7 on systems that ship with Python 3.8. Every time, cmake's findpackage() for Python picks the newer version. It's relevant for srbench environment because one of the methods requires Python 3.7: https://github.com/EpistasisLab/srbench/runs/2424814127?check_suite_focus=true#step:6:48

I'm trying variations of build arguments like:

SOURCE_DATE_EPOCH=`date +%s` cmake .. -DCMAKE_BUILD_TYPE=Release  -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON -DPython3_EXECUTABLE=$CONDA_PREFIX/bin/python -DPython3_LIBRARY=$CONDA_PREFIX/lib/ -DPython3_INCLUDE_DIR=$CONDA_PREFIX/include/ 
#-DPython3_ROOT_DIR=$CONDA_PREFIX
# -DPython3_FIND_STRATEGY=LOCATION 

Based on the cmake docs.
However, cmake either finds the newer version of Python or throws an errror.
Any ideas?

buliding problem

Hello, i'm a newer to this. When i try to build the operon on Linux and Windows, they came to the same problem:
"
CMake Error at CMakeLists.txt:78 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.

Could not find a package configuration file provided by "Eigen3" with any
of the following names:

Eigen3Config.cmake
eigen3-config.cmake

Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
"

Custom cost function

Hello,

just checking if it is possible to use a custom
cost function like

def mycost(expr_str):

 cost = myfun(eval(expr_str))
 return cost

Thnks

Question about running ctest based on the instructions in HACKING.md

The command I ran:

cmake --preset=dev

The error message I was getting:
We added -Wno-error=dev flag and was using vcpkg
The machine is based on Ubuntu.

Preset CMake variables:

  CMAKE_BUILD_TYPE="Release"
  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Wno-error=dev"
  CMAKE_CXX_STANDARD="17"
  CMAKE_CXX_STANDARD_REQUIRED="ON"
  operon_DEVELOPER_MODE="ON"

CMake Error (dev) at build/vcpkg_installed/x64-linux/share/FastFloat/FastFloatConfig.cmake:16 (foreach):
  uninitialized variable 'fast_float_FIND_COMPONENTS'
Call Stack (most recent call first):
  build/vcpkg_installed/x64-linux/share/FastFloat/FastFloatConfig.cmake:28 (check_required_components)
  CMakeLists.txt:82 (find_package)
This error is for project developers. Use -Wno-error=dev to suppress it.

no matching function for call to ‘max(double, ceres::TinySolver ... ::Scalar)’

I get this error when I run cmake with these options:

cmake .. -DCMAKE_BUILD_TYPE=Release  -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON

as recommended in issue #5.

[ 70%] Building CXX object CMakeFiles/pyoperon.dir/src/python/eval.cpp.o
/usr/bin/gcc-9 -DCERES_TINY_SOLVER -DUSE_SINGLE_PRECISION -Dpyoperon_EXPORTS -I/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/python -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/GSL/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/CSV/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/nanobench/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/xxhash -isystem /home/bill/anaconda3/envs/regression-benchmarks/include/python3.9 -isystem /home/bill/anaconda3/envs/regression-benchmarks/include/eigen3 -isystem /home/bill/anaconda3/envs/regression-benchmarks/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -Wall -Werror -Wextra -Wshadow -Wsign-compare -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion -O3 -g -fPIC -march=native -flto -fno-fat-lto-objects -std=gnu++17 -o CMakeFiles/pyoperon.dir/src/python/eval.cpp.o -c /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/src/python/eval.cpp
In file included from /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon/nnls/nnls.hpp:25,
                 from /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon/operators/evaluator.hpp:26,
                 from /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/src/python/eval.cpp:8:
/home/bill/anaconda3/envs/regression-benchmarks/include/ceres/tiny_solver.h: In instantiation of ‘const ceres::TinySolver<Function, LinearSolver>::Summary& ceres::TinySolver<Function, LinearSolver>::Solve(const Function&, ceres::TinySolver<Function, LinearSolver>::Parameters*) [with Function = Operon::DynamicAutoDiffCostFunction<Operon::ResidualEvaluator, ceres::Jet<float, 4>, 0>; LinearSolver = Eigen::LDLT<Eigen::Matrix<float, -1, -1>, 1>; ceres::TinySolver<Function, LinearSolver>::Parameters = Eigen::Matrix<float, -1, 1>; typename Function::Scalar = float]’:
/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon/nnls/nnls.hpp:115:17:   required from ‘ceres::Solver::Summary Operon::OptimizeTiny(Operon::Tree&, const Operon::Dataset&, gsl::span<const float>, Operon::Range, size_t, bool, bool) [with bool autodiff = true; size_t = long unsigned int]’
/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon/nnls/nnls.hpp:132:30:   required from ‘auto Operon::OptimizeTinyAutodiff(Args&& ...) [with Args = {Operon::Tree&, const Operon::Dataset&, const gsl::span<const float, 18446744073709551615>&, const Operon::Range&, long unsigned int&, bool&, bool&}]’
/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon/operators/evaluator.hpp:35:110:   required from here
/home/bill/anaconda3/envs/regression-benchmarks/include/ceres/tiny_solver.h:285:25: error: no matching function for call to ‘max(double, ceres::TinySolver<Operon::DynamicAutoDiffCostFunction<Operon::ResidualEvaluator, ceres::Jet<float, 4>, 0> >::Scalar)’
  285 |         u = u * std::max(1 / 3., 1 - tmp * tmp * tmp);

It goes away if I set -DCERES_TINY_SOLVER=OFF.

Expose functionnalities to python

Is there any plan to expose some API to python
using SWIG or PyBinGen ?

PYGMO is a project which has similar architecture than you, so it can done
relatively easily.

Update license and file headers

  • change license to MIT to match the other projects in heal-research
  • update file licence headers to attribute copyright to HEAL, keep author field for each file (use Ceres headers as model)

double free or corruption (out)

I've built operon_gp and have been using it somewhat successfully. However all my runs end up aborting with a message that appears to be memory corruption, which means that something is wrong, though it does print out the best function. Here is an example:

(3.17973e+06 + (4.91734e+07 * (((0.0305445 * x) - (((0.434294 * (1.89876 * x)) + (((-0.0614214) * ((-0.0544854) * x)) * ((0.0254102 * x) * ((-39.1706) + (0.434294 * x))))) - ((0.332126 * x) - ((((-0.173759) * x) + 1.18971) / ((-0.137136) * x))))) / ((7.01956 * x) - (((-0.0614214) * ((-44.5728) + ((0.0305445 * x) * (0.434294 * x)))) * ((0.0254102 * x) * ((-9.52858) + (0.43862 * x))))))))
double free or corruption (out)
runoperon.sh: line 17:  9970 Aborted                 operon_gp --dataset vax.xy.csv --target y --enable-symbols "add,sub,mul,div" --train 1:64 --maxlength 40 --maxdepth 8 --population-size 1000 --pool-size 1000 --generations 30000 --iterations 12 --evaluations 200000000 --threads 6

(runoperon.sh is a shell script that simply calls operon_gp)
The version:

operon rev. 1d035cd Release Linux-5.15.38 x86_64, timestamp 2022-07-18T20:04:20Z
single-precision build using eigen 3.4.0, ceres 2.1.0, taskflow 3.3.0
compiler: GNU-11.2.0, flags: -g -O3 -DNDEBUG

The functions that it has printed at the end are definitely fitting my data well, so from that point of view it is working. But since it aborts rather than terminate nicely I wonder if I am even getting all the output.

Do you have any idea what may be wrong?

eve::views::zip throws error

I have an issue with the use of eve in places like i.e. the non-dominated sorters.

hierarchical_sort.cpp

eve::algo::none_of(eve::views::zip(a, b), [](auto t)

or

rand_ordinal.cpp

auto k = m == 2
                ? (r.col(i) < r.col(j)).all()
                : eve::algo::all_of(eve::views::zip(std::span<int>(r.col(i).data(), r.col(i).size()), std::span<int>(r.col(j).data(), r.col(j).size())),
                                    [](auto t) { auto [a, b] = t; return a < b; });

Throw an issue with eve::views::zop because:

Suggest braces around initialization of subobject in instantiation of function template specialization 'kumi::forward_as_tuple<kumi::tuple<>, kumi::tuple<double>>' requested here in instantiation of function template specialization 'kumi::cat<kumi::tuple<>, kumi::tuple<double>>' requested here in instantiation of template class 'kumi::result::cat<kumi::tuple<>, kumi::tuple<double>>' requested here in instantiation of template type alias 'cat_t' requested here in instantiation of template type alias 'get_types_to_consider_for' requested here (skipping 19 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) while checking the satisfaction of concept 'relaxed_range<const std::vector<double> &>' requested here while substituting template arguments into constraint expression here while checking constraint satisfaction for template 'operator()<eve::algo::detail::supports_traits<eve::algo::views::zip_, const eve::algo::traits<rbr::settings<>>>>' required here in instantiation of function template specialization 'eve::algo::views::zip_<eve::algo::detail::supports_traits<eve::algo::views::zip_, const eve::algo::traits<rbr::settings<>>>>::operator()<const std::vector<double> &, const std::vecto... in instantiation of function template 

I am using gcc version 11.4.0 running on the latest Linux Mint.

Multi-target symbolic regression

Hi, I am working at Cineca and we have a vector symbolic regression problem to solve.
SymbolicRegression
In practice we need to find at the same time the 6 functions f_i coupled with the matrix C (which is not invertible).
Is it possible to have some help/suggestions in solving this problem?

Can't build on linux

Hello, thanks for making the code for this research open source.

I'm using gcc version 7.5.0 and g++ version 7.5.0 too. I ran this command:

make

and got this error:

Consolidate compiler generated dependencies of target operon
[  4%] Building CXX object CMakeFiles/operon.dir/src/core/tree.cpp.o
/home/dylan/Desktop/hftrs/operon/src/core/tree.cpp: In member function ‘size_t Operon::Tree::VisitationLength() const’:
/home/dylan/Desktop/hftrs/operon/src/core/tree.cpp:158:17: error: ‘transform_reduce’ is not a member of ‘std’
     return std::transform_reduce(nodes.begin(), nodes.end(), 0UL, std::plus<> {}, [](const auto& node) { return node.Length + 1; });
                 ^~~~~~~~~~~~~~~~
/home/dylan/Desktop/hftrs/operon/src/core/tree.cpp:158:17: note: suggested alternative: ‘random_device’
     return std::transform_reduce(nodes.begin(), nodes.end(), 0UL, std::plus<> {}, [](const auto& node) { return node.Length + 1; });
                 ^~~~~~~~~~~~~~~~
                 random_device
CMakeFiles/operon.dir/build.make:75: recipe for target 'CMakeFiles/operon.dir/src/core/tree.cpp.o' failed
make[2]: *** [CMakeFiles/operon.dir/src/core/tree.cpp.o] Error 1
CMakeFiles/Makefile2:132: recipe for target 'CMakeFiles/operon.dir/all' failed
make[1]: *** [CMakeFiles/operon.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

error in cmake

Hello,
I get the following error when running

cmake .. -DCMAKE_TOOLCHAIN_FILE=/Users/apdoshi/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release  -DBUILD_PYBIND=OF -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON
-- Running vcpkg install
Error: while loading aria-csv:
The port directory (/Users/apdoshi/vcpkg/ports/aria-csv) does not exist
Error: failed to load port from /Users/apdoshi/vcpkg/ports/aria-csv
note: updating vcpkg by rerunning bootstrap-vcpkg may resolve this failure.
-- Running vcpkg install - failed
CMake Error at /Users/apdoshi/vcpkg/scripts/buildsystems/vcpkg.cmake:858 (message):
  vcpkg install failed.  See logs for more information:
  /Users/apdoshi/operon/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.22.1/share/cmake/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:8 (project)

error: bad value (znver2) for -march= switch

Hi! Thanks for this nice package.

I'm trying to install operon on Ubuntu 16, using the default gcc 5.4.

At the moment, znver2 is only available in gcc 9, I gather. That makes its specification here pretty restrictive - only Ubuntu 20 ships with that version. Furthermore, the Zen 2 chip didn't come out til 2019, and I'm not sure how widespread it is.

I suggest that this flag not be hard-coded in the CMAKE file for linux installations. It would be great to instead pass it as a parameter to help us script the operon installation for regression benchmarks.

more details below.

Installation:

# Installing operon
git clone https://github.com/heal-research/operon
cd operon
# Dependencies 
# - oneTBB
echo "getting TBB"
git clone 
wget "https://github.com/oneapi-src/oneTBB/releases/download/v2021.1.1/oneapi-tbb-2021.1.1-lin.tgz" -O tbb.tgz
tar zxvf tbb.tgz -C thirdparty/
# - Eigen- 3.3.9, installed via conda
# - Ceres- 2.2.0, installed via conda
# - {fmt}- 7.1.3, installed via conda
# - cmake - 3.18.2, installed via conda

echo $CONDA_PREFIX
mkdir build; cd build; cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=thirdparty/oneapi-tbb-2021.1.1/ -DBUILD_PYBIND=ON
make VERBOSE=1

Output:

CMake Warning at CMakeLists.txt:14 (find_package):
  By not providing "Findcxxopts.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "cxxopts", but
  CMake did not find one.

  Could not find a package configuration file provided by "cxxopts" with any
  of the following names:

    cxxoptsConfig.cmake
    cxxopts-config.cmake

  Add the installation prefix of "cxxopts" to CMAKE_PREFIX_PATH or set
  "cxxopts_DIR" to a directory containing one of the above files.  If
  "cxxopts" provides a separate development package or SDK, be sure it has
  been installed.


-- Found pybind11: /home/bill/anaconda3/envs/regression-benchmarks/include (found version "2.6.1" )
CMake Warning at CMakeLists.txt:22 (find_package):
  By not providing "Finddoctest.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "doctest", but
  CMake did not find one.

  Could not find a package configuration file provided by "doctest" with any
  of the following names:

    doctestConfig.cmake
    doctest-config.cmake

  Add the installation prefix of "doctest" to CMAKE_PREFIX_PATH or set
  "doctest_DIR" to a directory containing one of the above files.  If
  "doctest" provides a separate development package or SDK, be sure it has
  been installed.


-- THIRDPARTY_INCLUDE_DIRS: /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/GSL/include;/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/CSV/include;/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/nanobench/include;/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/xxhash
-- Enabled features:
 * BUILD_PYBIND, Build python bindings [default=OFF].

-- Disabled features:
 * BUILD_TESTS, Build unit tests [default=OFF].
 * USE_OPENLIBM, Link against Julia's openlibm, a high performance mathematical library [default=OFF].
 * USE_JEMALLOC, Link against jemalloc, a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support [default=OFF].
 * USE_TCMALLOC, Link against tcmalloc (thread-caching malloc), a malloc(3) implementation that reduces lock contention for multi-threaded programs [default=OFF].
 * USE_MIMALLOC, Link against mimalloc, a general purpose allocator with excellent performance characteristics [default=OFF].
 * USE_SINGLE_PRECISION, Perform model evaluation using floats (single precision) instead of doubles. Great for reducing runtime, might not be appropriate for all purposes [default=OFF].
 * CERES_TINY_SOLVER, Use the tiny solver included in Ceres, intended for solving small dense problems with low latency and low overhead [default=OFF].
 * CERES_ALWAYS_DOUBLE, Always use double-precision for the scalar part of a jet. If not set then USE_SINGLE_PRECISION is used [default=ON].

-- Python bindings will be installed in /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build
/home/bill/anaconda3/envs/regression-benchmarks/bin/cmake -S/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon -B/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build --check-build-system CMakeFiles/Makefile.cmake 0
/home/bill/anaconda3/envs/regression-benchmarks/bin/cmake -E cmake_progress_start /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build/CMakeFiles /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
make  -f CMakeFiles/operon.dir/build.make CMakeFiles/operon.dir/depend
make[2]: Entering directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
cd /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build && /home/bill/anaconda3/envs/regression-benchmarks/bin/cmake -E cmake_depends "Unix Makefiles" /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build/CMakeFiles/operon.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
make  -f CMakeFiles/operon.dir/build.make CMakeFiles/operon.dir/build
make[2]: Entering directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
[  3%] Building CXX object CMakeFiles/operon.dir/src/core/tree.cpp.o
/usr/bin/c++ -DFMT_LOCALE -DFMT_SHARED -DGFLAGS_IS_A_DLL=0 -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -I/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/include/operon -isystem /home/bill/anaconda3/envs/regression-benchmarks/include/eigen3 -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/GSL/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/CSV/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/nanobench/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/xxhash -isystem /home/bill/anaconda3/envs/regression-benchmarks/include -isystem /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/thirdparty/oneapi-tbb-2021.1.1/include -O3 -DNDEBUG -Wall -Werror -Wextra -Wshadow -Wsign-compare -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion -O3 -g -march=znver2 -fPIC -std=gnu++1z -o CMakeFiles/operon.dir/src/core/tree.cpp.o -c /home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/src/core/tree.cpp
/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/src/core/tree.cpp:1:0: error: bad value (znver2) for -march= switch
 /* This file is part of:
 ^
CMakeFiles/operon.dir/build.make:81: recipe for target 'CMakeFiles/operon.dir/src/core/tree.cpp.o' failed
make[2]: *** [CMakeFiles/operon.dir/src/core/tree.cpp.o] Error 1
make[2]: Leaving directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
CMakeFiles/Makefile2:143: recipe for target 'CMakeFiles/operon.dir/all' failed
make[1]: *** [CMakeFiles/operon.dir/all] Error 2
make[1]: Leaving directory '/home/bill/projects/symbolic-regression/analysis/experiment/methods/src/operon/build'
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

ValueError: Input contains NaN, infinity or a value too large for dtype('float32').

Recently, I find that this package will raise an exception if my dataset is similar to the following one. I have no idea why this exception will happen because it is a normal dataset. Is there any possible solution to this problem?

import numpy as np
from operon.sklearn import SymbolicRegressor
from sklearn.model_selection import cross_val_score, train_test_split

X = np.random.rand(100, 5)
y = np.ones(100)
est = SymbolicRegressor(
    local_iterations=5,
    generations=10,  # just large enough since we have an evaluation budget
    n_threads=1,
    random_state=None,
    time_limit=2 * 60 * 60,  # 2 hours
    max_evaluations=int(5e5),
    population_size=10
)
print(cross_val_score(est, X, y))
print(y)

Building python binding and packaging

  • Description
    I'm building python binding; pyoperon from source with this install
    example. link. After several partially solved dependency
    dependency issues built successfully with some modifications in CMakeLists.txt.
    Testing current build with python package with python -c "from operon.sklearn import SymbolicRegressor"
    giving this error.

    • File "<string>", line 1, in <module> File "/github/home/miniconda/envs/operon-env/lib/python3.7/site-packages/operon/__init__.py", line 4, in <module> from ._operon import * ImportError: /github/home/miniconda/envs/operon-env/lib/python3.7/site-packages/operon/_operon.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3fmt2v76detail7vformatENS0_17basic_string_viewIcEENS0_11format_argsE Error: Process completed with exit code 1.
  • Modification on CMakeList.txt

    • Without this change build failed with /__w/zbuild/zbuild/operon/src/core/dataset.cpp:11:10: fatal error: vstat.hpp: No such file or directory 11 | #include "vstat.hpp" | ^~~~~~~~~~~ compilation terminated.

FetchContent_Declare(
vstat
GIT_REPOSITORY https://github.com/foolnotion/vstat
GIT_TAG 1ae255167708916cf1f9e494769ac978fdffd888
DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/thirdparty/vstat
SOURCE_DIR ${DOWNLOAD_DIR}
)

  • Without this change build cant find pratt.hpp

FetchContent_Declare(
infix_parser
GIT_REPOSITORY https://github.com/foolnotion/pratt-parser-calculator
GIT_TAG f2156e72a598763dc0be8be97d7ce765e61acfe9
DOWNLOAD_DIR ${PROJECT_SOURCE_DIR}/thirdparty/parser
SOURCE_DIR ${DOWNLOAD_DIR}
)

  • Conda environment

name: operon-env
channels:

  • conda-forge
    dependencies:
  • python=3.7.1
  • cmake=3.19.1
  • pybind11=2.6.1
  • eigen=3.4.0
  • fmt=7.1.3
  • ceres-solver=2.0.0
  • taskflow=3.1.0
  • openlibm
  • cxxopts
  • Build command
    cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON
    make VERBOSE=1 -j pyoperon
    make install

Python bindings

Have compiled operon in C++

How to re-use it for python binding ?

Where can I find a c++ example of using operon?

Hi!

It seems that the only example here is empty_example.cpp. I am wondering whether there is an example that can run at this moment? Really appreciate the help and also thank you for open sourcing this library!

Best,
-Break

Building operon fails with a compiler error

Hi, I am a PhD student interested in building and trying out operon. I tried the following (in a fresh Fedora 38 virtual machine):

sh <(curl -L https://nixos.org/nix/install) --no-daemon
# Log out and back in.
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
nix build github:heal-research/operon --no-write-lock-file

This fails with:

...
• Added input 'vstat/nixpkgs':
    'github:nixos/nixpkgs/be1e28024612051e1300b1ef7f325831185cad1a' (2023-04-26)
error: builder for '/nix/store/gnyv2phx4z5n9rblc6hs2j3ivfrxkjxc-operon.drv' failed with exit code 2;
       last 10 log lines:
       >       |                     ^~~
       > /build/source/include/operon/operators/evaluator.hpp: At global scope:
       > /build/source/include/operon/operators/evaluator.hpp:244:21: error: 'Map' in namespace 'Operon' does not name a template type
       >   244 |     mutable Operon::Map<size_t, size_t> divmap_;
       >       |                     ^~~
       > make[2]: *** [CMakeFiles/operon_operon.dir/build.make:104: CMakeFiles/operon_operon.dir/source/core/dataset.cpp.o] Error 1
       > make[2]: *** [CMakeFiles/operon_operon.dir/build.make:76: CMakeFiles/operon_operon.dir/source/algorithms/gp.cpp.o] Error 1
       > make[2]: *** [CMakeFiles/operon_operon.dir/build.make:90: CMakeFiles/operon_operon.dir/source/algorithms/nsga2.cpp.o] Error 1
       > make[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/operon_operon.dir/all] Error 2
       > make: *** [Makefile:156: all] Error 2
       For full logs, run 'nix log /nix/store/gnyv2phx4z5n9rblc6hs2j3ivfrxkjxc-operon.drv'.

Then I cloned the repo and tried the instructions in BUILDING.md (on Fedora 38 Silverblue):

nix develop --extra-experimental-features nix-command --extra-experimental-features flakes
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

Which fails with the same error 'Map' in namespace 'Operon' does not name a template type. Full CMake outputs are here and here.

This confuses me a bit because I am pretty sure that I successfully built operon earlier this month and the last commit to the master branch seems to be over a month old.

ModuleNotFoundError: No module named 'operon'

can't seem to find the module installed anywhere after running a successful install. Here's my setup:

# Installing operon
export CC=gcc-9
export CXX=gcc-9
# Dependencies 
# - TBB - installed via conda
# - Eigen- installed via conda
# - Ceres- installed via conda
# - {fmt}- installed via conda

git clone https://github.com/heal-research/operon
cd operon
# fix version
git checkout a45dd32

# run cmake
mkdir build; cd build; 
cmake .. -DCMAKE_BUILD_TYPE=Release  -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON

#install
make VERBOSE=1


python -c "from operon.sklearn import SymbolicRegressor"

I do see operon shared and static objects in the build/ folder:

ls build
buildinfo.hpp  CMakeCache.txt  CMakeFiles  cmake_install.cmake  _deps  liboperon.a  Makefile  _operon.cpython-39-x86_64-linux-gnu.so

installing operon is now part of CI in our regression-benchmarks project. If you have time maybe you can help update the script to get the build working on dev.

this is the install script: https://github.com/EpistasisLab/regression-benchmark/blob/dev/experiment/methods/src/operon_install.sh

building operon

I am completely new to this, I followed your document step by step and when I did the 'make -j pyoperon' step at the end, I got this error, can you please tell me what is the reason? THANKS a lot!!!

image

  • Build command

mkdir build && cd build
cmake .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PYBIND=ON -DUSE_OPENLIBM=ON -DUSE_SINGLE_PRECISION=ON -DCERES_TINY_SOLVER=ON
make -j pyoperon

About implementing specific custom primitives

Sorry about using GitHub issues for asking questions again. After switching to cpp20 branch I was able to successfully run examples. Thanks!

Now I would like to discuss on whether (and how) the following can be achieved. The dataset that I having is actually a time series which is ordered. This means that theoretically primitives such as "shift 1" and "shift -1" or "rolling mean" are valid primitives that can batch operate on each of the original variables and intermediate variables. After briefly reading the code, mainly functions.hpp, I have a few questions on how to implement the above:

  1. It seems that there is an upper limit on the number of primitives we can have because NodeType is 32 bit integer. If I would like to add more primitives, should I extend this to uint64_t?
  2. It seems that each time when the primitive in function.cpp is called, it is called on a batch of a variable or intermediate. Is it possible to make it call across the whole dataset (across the data point dimension, which in the time series case is the time dimension)?
  3. If the above two can be resolved, I think I can probably come up with a solution. Is there any other approach that you would recommend?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.