Skip to content

Deprecate the Lambda() and Sigma() functions for AugLagrangian - #439

Merged
rcurtin merged 8 commits into
mlpack:masterfrom
rcurtin:deprecate-lambda
Sep 25, 2025
Merged

Deprecate the Lambda() and Sigma() functions for AugLagrangian#439
rcurtin merged 8 commits into
mlpack:masterfrom
rcurtin:deprecate-lambda

Conversation

@rcurtin

@rcurtin rcurtin commented Sep 15, 2025

Copy link
Copy Markdown
Member

During the review process for #352, we identified that the AugLagrangian class, like the multi-objective optimizers, had a template parameter that it shouldn't and stored state that was really a result of the optimization and should be something returned by Optimize(). So, before this PR, if you wanted to get the Lagrange multipliers and penalty parameter after optimization, you would do:

arma::vec lambda;
double sigma;
opt.Optimize(function, coordinates);

lambda = opt.Lambda();
sigma = opt.Sigma();

However, much like the pareto front and population for multi-objective optimizers, this is really something that should be done more like this:

arma::vec lambda;
double sigma;
opt.Optimize(function, coordinates, lambda, sigma);

This PR makes that change (although there was some extra work necessary to disambiguate different overloads). Documentation is updated too.

@conradsnicta
conradsnicta requested review from shrit and zoq September 23, 2025 12:35

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Second approval provided automatically after 24 hours. 👍

@rcurtin
rcurtin merged commit a8f6e78 into mlpack:master Sep 25, 2025
6 checks passed
@rcurtin
rcurtin deleted the deprecate-lambda branch September 25, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants