Coder Social home page Coder Social logo

roboptim-shared-tests's People

Contributors

bchretien avatar delca avatar fdarricau avatar florent-lamiraux avatar francois-keith avatar kayusawa avatar stanislas-brossette avatar thomas-moulard avatar

Stargazers

 avatar

Watchers

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

roboptim-shared-tests's Issues

Add tests that show the influence of sparse matrices

For now, the tests available are too "small" to really demonstrate the influence of the sparsity of the Jacobian matrix for solvers that support it. We need larger sparse problems to really compare dense and sparse implementations.

What we could do at first is create a RobOptim filter that "duplicates" or "copy-pastes" a problem to artificially increase its size:

Problem:              --->     Enlarged problem:
  cost: f(x0,x1)                  cost: f(x0,x1) + f(x2,x3) + f(x4,x5) + ...
  constraints:                    constraints:
    g0(x0,x1)                       g0_0(x0,x1), g0_1(x2,x3), g0_2(x4,x5), ...
    g1(x0,x1)                       g1_0(x0,x1), g1_1(x2,x3), g1_2(x4,x5), ...

The solver would be solving several times the same problem, with a very sparse structure. Also, if we know the optimal solution of the problem, we also know the optimal solution of the enlarged problem.

Having actual problems would of course be better, but this trick may be sufficient for now.

Workload for Travis CI

Now that we have roughly 120 tests if compiled in dense + sparse, I'm afraid that we are reaching the limits set in Travis CI, cf. the last build log for the Ipopt plugin:

[ 90%] Building CXX object tests/CMakeFiles/problem_66-sparse.dir/shared-tests/schittkowski/problem_66.cc.o
cd /tmp/_travis/build/tests && /usr/bin/g++   -DHAVE_CSTDDEF -DHAVE_STDDEF_H -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN --coverage -Werror  -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -fvisibility=hidden -I/tmp/_travis/build -I/tmp/_travis/build/include -I/home/travis/build/roboptim/roboptim-core-plugin-ipopt/include -I/home/travis/build/roboptim/roboptim-core-plugin-ipopt/tests/shared-tests -isystem /tmp/_travis/install/include -isystem /tmp/_travis/install/include/eigen3    -DSOLVER_NAME='"ipopt-sparse"' -DPLUGIN_PATH='"/tmp/_travis/build/src"' -DFUNCTION_TYPE=::roboptim::EigenMatrixSparse -DCOST_FUNCTION_TYPE=::roboptim::GenericDifferentiableFunction -DCONSTRAINT_TYPE_1=::roboptim::GenericLinearFunction -DCONSTRAINT_TYPE_2=::roboptim::GenericDifferentiableFunction -DTESTS_DATA_DIR='"/home/travis/build/roboptim/roboptim-core-plugin-ipopt/tests"' -DLOG_FILENAME='"problem_66-sparse.log"'  -DROBOPTIM_DO_NOT_CHECK_ALLOCATION -DEIGEN_RUNTIME_NO_MALLOC -I/tmp/_travis/install/include -I/tmp/_travis/install/include/eigen3 -o CMakeFiles/problem_66-sparse.dir/shared-tests/schittkowski/problem_66.cc.o -c /home/travis/build/roboptim/roboptim-core-plugin-ipopt/tests/shared-tests/schittkowski/problem_66.cc


I'm sorry but your test run exceeded 50.0 minutes. 

One possible solution is to split up your test run.

We may need to select a subset of the tests to remain within the bounds, until caching becomes available (e.g. caching Eigen 3.2 and roboptim-core).

Fix tests when multiple optimal solutions exist

cc @thomas-moulard

While checking problem_9 with the Ipopt plugin, I realized that Ipopt returns:

Result: 
  Size (input, output): 2, 1
  X: [2](-39,-52)
  Value: [1](-0.5)
  Constraints values: [1](0)
  Lambda: [1](-0.0327249)

Yet the test fails because it expects:

// minimal local are x_k for k = 0, +/-1, +/-2, etc.
const double ExpectedResult:: k = 0;
const double ExpectedResult::x[] = {12 * k - 3, 16 * k - 4};
const double ExpectedResult::fx = -.5;

i.e. Ipopt converges to the solution for k = -3, but it is tested against k = 0.

I guess we could compare fx and test the constraints, and if fx is wrong or the constraints are violated, we then compare x to help the user investigate the issue.

Regroup tests by optimization problem "properties"

Different solvers can handle different kinds of problems: constrained or unconstrained, support for equality constraints etc. I guess we could find a way to help filter relevant problems for a given solver, rather than trying to launch the whole Schittkowski test suite or expect the developer to go through each problem to find the ones that could work.

I guess that information could be processed by tests.cmake or Schittkowski's CMakeLists.txt to only use relevant problems.

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.