Skip to content

Conversation

@devmotion
Copy link
Contributor

Very much WIP, and I might have to start over again. Fixes #1210 (comment) by not (mis)using objective functions as states. Instead, this PR proposes to add f_x and g_x fields to the optimization states (where needed), similar to already existing x_previous, f_x_previous and g_x_previous fields.

@devmotion devmotion force-pushed the dmw/do_not_misuse_objective_as_state branch 2 times, most recently from 935c749 to 93e8f31 Compare November 26, 2025 12:27
end

if g_calls(d) > 0 && !all(isfinite, gradient(d))
if hasproperty(state, :g_x) && !all(isfinite, state.g_x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could in principle add methods to isfinite_gradient and isfinite_hessian that you introduced for the objective? I suppose they are sufficiently similar in nature to share the function?

Copy link
Member

@pkofod pkofod Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's only used once of course... then it's maybe overkill :) I suppose in termination code as well..

@devmotion devmotion force-pushed the dmw/do_not_misuse_objective_as_state branch 2 times, most recently from ec47faa to ac80b59 Compare November 26, 2025 19:05
@devmotion devmotion force-pushed the dmw/do_not_misuse_objective_as_state branch from ac80b59 to e3f747e Compare November 26, 2025 23:16
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

Successfully merging this pull request may close these issues.

2 participants