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

Optimization improvements #2214

Closed
wants to merge 1 commit into from

Conversation

torfjelde
Copy link
Member

@torfjelde torfjelde commented May 2, 2024

IMO the current optimization we provide is quite lacking. In particular, it seems (I couldn't get it to work with constrained models) as if we support the Optimizations.jl interface through SciMLBase, but it's not really exposed nor documented. Moreover, it's exposed through this optim_problem (which is also exported btw) that returns several things that might not be obvious to the user.

I suggest the following:

  1. Clean up the src/optimization module.
  2. Define two methods maximum_a_posteriori(model, solver; kwargs...) and maximum_likelihood(model, solver; kwargs...), where the solver is whatever Optimizations.jl accepts (and similarly the kwargs).
  3. Fix whatever is going on with the constrained models not working.
  4. Make adtype have some default type. Currently, if you try to use something like Optim.Newton, it will error with some obscure message which really just comes down to the fact that adtype=SciMLBase.NoAD() (which is contrary to everything else we do in Turing.jl, which is all "ad is enabled by default", no?)

Related: #2164

@mhauru

@torfjelde torfjelde marked this pull request as draft May 2, 2024 16:29
Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (c29d36e) to head (902ed18).
Report is 9 commits behind head on master.

Files Patch % Lines
src/optimisation/Optimisation.jl 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #2214    +/-   ##
=======================================
  Coverage    0.00%   0.00%            
=======================================
  Files          21      22     +1     
  Lines        1367    1534   +167     
=======================================
- Misses       1367    1534   +167     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yebai
Copy link
Member

yebai commented May 5, 2024

Maybe also take a look at #2152 to see why it is causing issues along the process.

@mhauru mhauru self-assigned this May 7, 2024
@torfjelde
Copy link
Member Author

Maybe also take a look at #2152 to see why it is causing issues along the process.

I don't think this has anything to do with this issue. Isn't that just because of incompatibilities wrt. ADTypes v1? Some downstream packages are still not up-to-date IIRC.

@yebai
Copy link
Member

yebai commented May 18, 2024

Superseded by #2221

@yebai yebai closed this May 18, 2024
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.

None yet

3 participants