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

Using Optimization.MaxSense #143

Open
sethaxen opened this issue Jun 23, 2023 · 1 comment
Open

Using Optimization.MaxSense #143

sethaxen opened this issue Jun 23, 2023 · 1 comment

Comments

@sethaxen
Copy link
Member

Currently we need to negate the user-provided function, gradients, and Hessian to to maximize the log-density with Optimization.jl, which by default assumes the optimization problem should be minimized. However, OptimizationProblem can take a sense=Optimization.MaxSense keyword to treat the optimization problem as a maximization one.

This is only worth doing if we can make sure that whether we use Optim.jl or Optimization.jl, the downstream code can be the same.

@sethaxen
Copy link
Member Author

Coming back to this, Optimization/SciMLBase use OptimizationFunction purely to specify the function and derivatives. There's absolutely no information contained there to indicate whether this function will ultimately be maximized or minimized. That information is contained in sense of OptimizationProblem.

Thus, it makes sense for us to remove OptimizationFunction as an allowed type a user can provide and instead just take OptimizationProblem, as we do now. Then we can set MaxSense whenever we construct a problem and otherwise read the sense parameter for a user-provided problem to interpret the function as a positive or negative log-density.

Turing has a utility function for us to construct a problem (they don't set sense, so they default to MinSense), but we need to check that Turing can take our initialization.

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

1 participant