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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/optimisation/Optimisation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@
optim_function,
optim_problem


# TODO(torfjelde): Make these two methods work.
function maximum_a_posteriori(model::DynamicPPL.Model, solver; kwargs...)

Check warning on line 29 in src/optimisation/Optimisation.jl

View check run for this annotation

Codecov / codecov/patch

src/optimisation/Optimisation.jl#L29

Added line #L29 was not covered by tests
# NOTE: Don't know why we need the `init` and `transform` here.
prob, init, transform = optim_problem(model, MAP(); kwargs...)
return SciMLBase.solve(prob, solver)

Check warning on line 32 in src/optimisation/Optimisation.jl

View check run for this annotation

Codecov / codecov/patch

src/optimisation/Optimisation.jl#L31-L32

Added lines #L31 - L32 were not covered by tests
end

function maximum_likelihood(model::DynamicPPL.Model, solver; kwargs...)

Check warning on line 35 in src/optimisation/Optimisation.jl

View check run for this annotation

Codecov / codecov/patch

src/optimisation/Optimisation.jl#L35

Added line #L35 was not covered by tests
# NOTE: Don't know why we need the `init` and `transform` here.
prob, init, transform = optim_problem(model, MLE(); kwargs...)
return SciMLBase.solve(prob, solver)

Check warning on line 38 in src/optimisation/Optimisation.jl

View check run for this annotation

Codecov / codecov/patch

src/optimisation/Optimisation.jl#L37-L38

Added lines #L37 - L38 were not covered by tests
end

# TODO(torfjelde): Don't think we need this constrained space struct?
struct constrained_space{x} end

struct MLE end
Expand Down
Loading