Skip to content

Commit

Permalink
fix bounds translation
Browse files Browse the repository at this point in the history
fixes #498
  • Loading branch information
ChrisRackauckas committed Mar 4, 2021
1 parent 56f2102 commit 331ec8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/train.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function sciml_train(loss, θ, opt, adtype::DiffEqBase.AbstractADType = GalacticOptim.AutoZygote(), args...; kwargs...)
function sciml_train(loss, θ, opt, adtype::DiffEqBase.AbstractADType = GalacticOptim.AutoZygote(), args...;
lower_bounds = nothing, upper_bounds = nothing, kwargs...)
optf = GalacticOptim.OptimizationFunction((x, p) -> loss(x), adtype)
optfunc = GalacticOptim.instantiate_function(optf, θ, adtype, nothing)
optprob = GalacticOptim.OptimizationProblem(optfunc, θ; kwargs...)
optprob = GalacticOptim.OptimizationProblem(optfunc, θ; lb = lower_bounds, ub = upper_bounds, kwargs...)
GalacticOptim.solve(optprob, opt, args...; kwargs...)
end

0 comments on commit 331ec8b

Please sign in to comment.