j-asefa / slsqp4j

A JVM wrapper for the popular SLSQP optimizer
Other
27 stars 7 forks source link

Allow setting epsilon #9

Open disacrol opened 2 years ago

disacrol commented 2 years ago

https://github.com/skew-opensource/slsqp4j/blob/443dfb3e45e684385fdde30a5790db80cfa64cbb/slsqp4j/src/main/java/com/skew/slsqp4j/Jacobian.java#L51

Could this be editable? Have a use case for this algorithm where this default value is too small to work. Or is there a different, more adequate way to effectively use a different "epsilon" value?

jamesasefa commented 2 years ago

This value is machine-specific, curious why it would be too small to work? It just represents the h value in the standard derivative formula needed to calculate the Jacobian:

aae79a56cdcbc44af1612a50f06169b07f02cbf3

disacrol commented 2 years ago

Problem is in a scenario where the objective function is not a closed-form expression - instead it corresponds to the concatenation of several independent blocks, and the final results do not change with such small epsilon value in the Jacobian formula you mention there.

jamesasefa commented 2 years ago

Hi @disacrol this should be doable. I'd welcome a PR from you that allowed setting epsilon!

disacrol commented 1 year ago

@jamesasefa I am onto it. But I'll take the chance to revert again the changes done by @pkernevez in PR #12. Otherwise I won't be able to proceed as I work on windows. For more details check Issue #15.

Thanks,