Code Monkey home page Code Monkey logo

cselab / korali Goto Github PK

View Code? Open in Web Editor NEW
70.0 10.0 21.0 301.03 MB

High-performance framework for uncertainty quantification, optimization and reinforcement learning.

Home Page: https://www.cse-lab.ethz.ch/korali/

License: MIT License

Makefile 0.35% C++ 80.81% Python 13.16% Shell 2.05% Meson 2.48% C 0.95% CSS 0.01% HTML 0.15% Dockerfile 0.03% CMake 0.01%
python uncertainty-quantification optimization-methods reinforcement-learning cplusplus

korali's Issues

cCMA-ES

implement PASC cCMA-ES for constrained optimization

korali-cxx

duplicate?
why is this in

  • skorali/korali/bin/korali-cxx
  • skorali/tools/korali-cxx

Unit Test

unit test for important functionalities, such as:

  • a
  • b
  • c

Default params

reevaluate default params:

  • tolcov = 1.0
  • beta = 0.2
  • lambda in cma-es 4+3*log(N)
  • mu = lambda / 2

json config booleans

adding a boolean config:

_diag = consume(js, { "Diag" }, KORALI_BOOLEAN, std::to_string(true));
or
_diag = consume(js, { "Diag" }, KORALI_BOOLEAN, std::to_string(false));

creates this error

terminate called after throwing an instance of 'nlohmann::detail::type_error'
what(): [json.exception.type_error.302] type must be boolean, but is number
Aborted

I assume that to_string creates a 0 or 1 out of the boolean and hence this error?

No burn-in in first generation

We don't need burn-in in the first generation.

When I delete the _burnIn variable from for (size_t c = 0; c < _s; c++) chainLength[c] = 1 + _burnIn; I get the error:

[Korali] Generation 0 - Annealing Ratio:  0.00% - Elapsed Time: 1.559227s
gsl: simplex2.c:372: ERROR: non-finite function value encountered
Default GSL error handler invoked.
Aborted

when run the heat2d sample_posterior

diag init

init diag from json config (now by default false)

dependency: #49

error in mac compilation

When compiling with clang

In file included from solvers/tmcmc.cpp:1:
../include/solvers/tmcmc.h:72:47: warning: explicitly assigning value of variable of type 'double' to itself [-Wself-assign]
        void setToleranceCOV(double TolCOV) { TolCOV = TolCOV; }
                                              ~~~~~~ ^ ~~~~~~
../include/solvers/tmcmc.h:74:50: warning: explicitly assigning value of variable of type 'double' to itself [-Wself-assign]
        void setCovarianceScaling(double bbeta) { bbeta = bbeta; }
                                                  ~~~~~ ^ ~~~~~
problems/base.cpp:9:62: fatal error: no viable conversion from 'time_point<[...], duration<[...], ratio<[...], __static_lcm<ratio<1, 1000000>::den,
      ratio<1, 1000000000>::den>::value aka 1000000000>>>' to 'const time_point<[...], duration<[...], ratio<[...], 1000000>>>'
    std::time_t now_c = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now() - std::chrono::nanoseconds(0));
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When compiling with g++-8

g++-8 -o sample_posterior sample_posterior.o model/heat2d.o `gsl-config --libs` -lm  -pthread -D_KORALI_USE_PTHREADS -L../../source -lkorali
ld: warning: ignoring file ../../source/libkorali.a, file was built for archive which is not the architecture being linked (x86_64): ../../source/libkorali.a
Undefined symbols for architecture x86_64:
  "Korali::Solver::Base::run()", referenced from:
      _main in sample_function.o
  "Korali::Solver::TMCMC::TMCMC(Korali::Problem::Base*)", referenced from:
      _main in sample_function.o
  "Korali::Problem::Base::addParameter(Korali::Parameter::Base*)", referenced from:
      _main in sample_function.o
  "Korali::Problem::Direct::Direct(double (*)(double*), unsigned long)", referenced from:
      _main in sample_function.o
  "Korali::Parameter::Uniform::Uniform(double, double)", referenced from:
      _main in sample_function.o
ld: symbol(s) not found for architecture x86_64
ld: warning: ignoring file ../../source/libkorali.a, file was built for archive which is not the architecture being linked (x86_64): ../../source/libkorali.a
Undefined collect2: error: ld returned 1 exit status
symbols for architecture x86_64:
  "Korali::Solver::Base::run()", referenced from:
      _main in sample_function.o
  "Korali::Solver::TMCMC::TMCMC(Korali::Problem::Base*)", referenced from:
      _main in sample_function.o
  "Korali::Problem::Base::addParameter(Korali::Parameter::Base*)", referenced from:
      _main in sample_function.o
  "Korali::Problem::Direct::Direct(double (*)(double*), unsigned long)", referenced from:
      _main in sample_function.o
  "Korali::Parameter::Uniform::Uniform(double, double)", referenced from:
      _main in sample_function.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [sample_function] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [sample_function] Error 1
make[2]: *** Waiting for unfinished jobs....
ld: warning: ignoring file ../../source/libkorali.a, file was built for archive which is not the architecture being linked (x86_64): ../../source/libkorali.a

Prior General

I dont know how this case is treated:
what if you add the same prior twice to a problem? this should create errors / warnings, probably this changes the sampling adversly.

config parse bug for strings

segfault for configurations

{ "Mu", "Type" }
{ "Termination Criteria", "Ignore" }

(is it because we have default values? assigning Parameter Distribution & Type works)

if we assign strings:
korali["Solver"]["Mu"]["Type"] = "Logarithmic";

or

korali["Solver"]["Termination Criteria"]["Ignore"] = "MinDeltaX";

at
#10 0x000000000043c23d in Korali::Parameter::Base::getConfigurationabi:cxx11 (this=0x675660) at parameters/base/base.cpp:49

Min max EW/DIAG output

bug in calculation or output

[Korali] Min Diag C: -nan - Max Diag C: -nan
[Korali] Min EW C: -nan - Max EW C: -nan

installation bugs

  • checkout skorali
  • module load new gcc/6.3.0
  • module load python/3.7.1
    ./configure

(check korali.configure, remove upcxx relevant flags, check python flag set)

make install

../libs/pybind11/detail/common.h:112:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
make[1]: *** [korali.shared.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/cluster/home/wadaniel/skorali/source'
make: *** [source/libkorali.so] Error 2

for reference:

wadaniel@eu-login-16-ng:~/skorali/examples/cxx/ackley$ module list
Currently Loaded Modulefiles:

  1. new 2) gcc/6.3.0 3) openblas/0.2.13_seq(default:seq) 4) python/3.7.1
    wadaniel@eu-login-16-ng:~/skorali/examples/cxx/ackley$

helper functions

find a place for helper functions, such as
doubleRangeMin
doubleRangeMax

in CMA-ES

more to come (e.g. vector printing)

Seed CMA-ES

Seed not working properly on Euler,
I found that all runs executed with same seed, or did they really start at the SAME time (nanosec)?

Clearer Output

  • CMA-ES termination criteria
  • CMA-ES best found optimum, per generation
  • why rho does not update, where it hangs
  • ...

Add Chain Burn-In

I took these off when creating the new variant of sKorali's TMCMC. Time to put it back again

make tests not working, korali-cxx command not found

./configure
[Korali] Checking for GNU Scientific Library (GSL)...
[Korali] Success: gsl-config found.
[Korali] Configuring without support for MPI Conduit/Applications.
[Korali] Configuring without support for UPC++ Conduit/Applications.
[Korali] Configuring without support for the Pthreads Conduit.
[Korali] Configuring without support for the OpenMP Conduit.
[Korali] Creating common.mk...
[Korali] Configuration was successful.
[Korali] Run 'make' to build Korali.

make
make[1]: Entering directory /cluster/home/wadaniel/projects/skorali/source' make[1]: Nothing to be done for all'.
make[1]: Leaving directory `/cluster/home/wadaniel/projects/skorali/source'

make tests

make[1]: Entering directory /cluster/home/wadaniel/projects/skorali/source' make[1]: Nothing to be done for all'.
make[1]: Leaving directory /cluster/home/wadaniel/projects/skorali/source' [Korali] Installing Korali... mkdir -p /cluster/home/wadaniel/projects/skorali/korali/lib mkdir -p /cluster/home/wadaniel/projects/skorali/korali/include mkdir -p /cluster/home/wadaniel/projects/skorali/korali/bin cp source/libkorali.a /cluster/home/wadaniel/projects/skorali/korali/lib cp libs/json -r /cluster/home/wadaniel/projects/skorali/korali/include cp libs/koralijson -r /cluster/home/wadaniel/projects/skorali/korali/include make -j -C tests/rosenbrock/ make[1]: Entering directory /cluster/home/wadaniel/projects/skorali/tests/rosenbrock'
korali-cxx -c minimize_function.cpp
make[1]: korali-cxx: Command not found
make[1]: *** [minimize_function.o] Error 127
make[1]: Leaving directory `/cluster/home/wadaniel/projects/skorali/tests/rosenbrock'
make: *** [tests/rosenbrock/] Error 2

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.