Skip to content

Commit

Permalink
fix bounds translation (#499)
Browse files Browse the repository at this point in the history
* fix bounds translation

fixes #498

* patch release
  • Loading branch information
ChrisRackauckas authored Mar 4, 2021
1 parent 56f2102 commit d23fa12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DiffEqFlux"
uuid = "aae7a2af-3d4f-5e19-a356-7da93b79d9d0"
authors = ["Chris Rackauckas <[email protected]>"]
version = "1.34.0"
version = "1.34.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
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 d23fa12

Please sign in to comment.