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

Difference between bfgs.rs and bfgs of optimtool.unconstrain.newton_quasi #498

Closed
linjing-lab opened this issue Apr 29, 2024 · 2 comments
Closed

Comments

@linjing-lab
Copy link

In compiled languages, using the method of state to prompt whether to initialize the parameter vector is a consideration for developers not to treat it as a dynamic tuning method, but to use it to adapt to compilation logic for embedded code?

let param = state.take_param().ok_or_else(argmin_error_closure!(
NotInitialized,
concat!(
"`BFGS` requires an initial parameter vector. ",
"Please provide an initial guess via `Executor`s `configure` method."

the above code may be same as the underlined code by given initial point:

gradient = np.array(res.subs(reps)).astype(DataType) # optimtool/unconstrain/newton_quasi.py#L64

let param = state.take_param().ok_or_else(argmin_error_closure!(
PotentialBug,
"`BFGS`: Parameter vector in state not set."

I have never occured such issue about not set in state, did function parameters make all the initial operations but stop the iteration because of not set in state?
let xk1 = sub_state.take_param().ok_or_else(argmin_error_closure!(
PotentialBug,
"`BFGS`: No parameters returned by line search."

if I understand here, No parameters means bfgs.rs may stop iteration in intensive program because of line search, and when give a complicated function to adapt to an embedded program, a developer need many trials according to the exact problem which to process.

@stefan-k
Copy link
Member

stefan-k commented May 1, 2024

These are safety hatches in case a bug is introduced somewhere. Apart from the check in init, these should never lead to an error in normal operation. The one in init is a hint to the user in case they forget to provide a parameter vector.
This will likely become unnecessary when state handling is improved (#478).

Does this answer your question?

@linjing-lab
Copy link
Author

OK, that's really a considerable choice on handling future state.

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

2 participants