Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regularization of the Hessian matrix #21

Open
aescande opened this issue Jan 13, 2017 · 0 comments
Open

Regularization of the Hessian matrix #21

aescande opened this issue Jan 13, 2017 · 0 comments

Comments

@aescande
Copy link
Contributor

Once the quadratic matrices of all tasks have been aggregated, there is a piece of code attempting to make the resulting matrix positive definite.

I have several remarks on this:

  • because the test is if(std::abs(Q(i, i)) < DIAG_CONSTANT), the code does not perform as documented, i.e. if Q(i, i) < -DIAG_CONSTANT, Q(i,i) is not made positive. This case should not arise unless someone directly provide a tasks::qp::Task with non positive Q. In my opinion, the code should be
    if(Q(i, i) < DIAG_CONSTANT) { Q(i, i) = DIAG_CONSTANT; }
  • DIAG_CONSTANT should not be absolute, but scaled depending the magnitude of the matrix. Otherwise, if a user chose tasks with very small weights, they will be very disturbed by the regularization. From discussions I had today, some user would naturally chose small gains to express priority between tasks. Since this regularization is deep in the code (and I think not documented), this is a potential source of error/bad control.
  • if one assume that all "tasks" are of the form ||A_i x + b_i||^2_{W_i} or ||x - xref||^2_{W_i}, then having Q positive definite is only a matter of having a non-zero diagonal element for unused DoFs. This has to be done only once after adding or removing a task.
  • if one want to be more general and ensure that the matrix is really positive, then one could perform a rank-revealing L D L^T and render D positive. This will have barely no overhead if the solver is made to accept the factorized version of the Hessian, which both LSSOL and QLD accepts.
  • of course, given that Tasks is quite low-level, one could also consider that it is the responsibility of the user to specify a well-posed problem. In particular, if the tasks are not using all DoFs, the user should add a damping term. In this case the regularization should be simply removed.

Any opinion on this? I can provide a patch easily for the 2 first points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant