8000 Python: optional parametrization of `W` when reformulating (non)linear least-squares cost as external cost by sandmaennchen · Pull Request #1377 · acados/acados · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Python: optional parametrization of W when reformulating (non)linear least-squares cost as external cost #1377

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

Merged
merged 7 commits into from
Nov 28, 2024

Conversation

sandmaennchen
Copy link
Contributor
@sandmaennchen sandmaennchen commented Nov 27, 2024

Extend translate_cost_to_external_cost with an optional parametrization of the weighting matrix. The user now needs to provide additional p and p_global symbolics (and values).

Also: Improve checks in setters of parameter_values and p_global_values

Copy link
Contributor
@dirkpr dirkpr left a comment

Choose a reason for hiding this comment

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

Looks good, only some comments. Should W_params be a concatentation of W columns or the W matrix directly?

@FreyJo FreyJo changed the title python: optional parametrization of W when reformulating (non)linear least-squares cost as external cost Python: optional parametrization of W when reformulating (non)linear least-squares cost as external cost Nov 27, 2024
Copy link
Member
@FreyJo FreyJo left a comment

Choose a reason for hiding this comment

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

Maybe appending the values and symbolics for the parameters is more restrictive than useful here.
One common scenario could be W_0 = diag(p_w), W = diag(p_w), W_e = diag(p_w[:nx]).
As it is now, the function does not allow "reusing" parameters in this way.

If this limitation is acceptable, we should maybe sanitize the input, such that param_W etc. do not depend on each other.

@sandmaennchen sandmaennchen requested a review from FreyJo November 28, 2024 09:49
@sandmaennchen sandmaennchen force-pushed the reformulate_to_external branch from 7c2d220 to a915157 Compare November 28, 2024 10:21
@FreyJo FreyJo merged commit 4b95194 into acados:master Nov 28, 2024
14 checks passed
@sandmaennchen sandmaennchen deleted the reformulate_to_external branch November 28, 2024 11:26
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.

3 participants
0