Implementing inequality constraints by returning false from cost function

28 views
Skip to first unread message

Joseph DeCunha

unread,
Mar 23, 2023, 6:01:39 PM3/23/23
to Ceres Solver
Hi all,

I'm trying to implement an inequality constraint by having my cost function return "false" when the function being optimized takes on negative values over a certain range. I haven't had any success using this method however. On the first iteration of the optimizer, the message returned is: "trust_region_minimizer.cc:71] Terminating: Residual and Jacobian evaluation failed".

I assume this is because, even if I set an initial guess is set which is in a valid region, when numeric differentiation occurs some of the calls to the cost function are in the "forbidden region" preventing the derivative from being calculated.

Primarily, my question is, have others had success using this approach for setting inequality constraints while using numeric differentiation? and if so, can you provide any advice on how to proceed?

Thank you very much,

Joseph DeCunha

Sameer Agarwal

unread,
Mar 23, 2023, 6:04:10 PM3/23/23
to ceres-...@googlegroups.com
Hi Joseph, This is indeed a problem with numeric differentiation. It is not aware of manifold or inequality constraints :/
Sameer


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/0a124c0a-5828-4b4d-a5d4-421ee413eaf3n%40googlegroups.com.

Joseph DeCunha

unread,
Mar 23, 2023, 6:14:49 PM3/23/23
to Ceres Solver
Thanks for your fast reply!

I will try implementing some penalty terms in the cost function rather than returning false.

Best,

Joseph

Reply all
Reply to author
Forward
0 new messages