-
Notifications
You must be signed in to change notification settings - Fork 28
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
Introduce Constraints objects #38
Conversation
302f0f3
to
dc2b38f
Compare
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 77.38% 83.84% +6.46%
==========================================
Files 9 10 +1
Lines 199 291 +92
==========================================
+ Hits 154 244 +90
- Misses 45 47 +2
Continue to review full report at Codecov.
|
This is ready to go. Can someone review the changes, please? |
Looks good. I'm wondering if we should simply use the existing NDifferentiable setup for the constraints, and have the constraints be a wrapper around an NDifferentiable and ConstraintsBounds? Would buy us AD, counters, etc automatically. We can always iterate on this in the future... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Yes, if that's possible it will be very useful :) |
I don't see why it wouldn't? Currently a constraint is simply a function and it's derivative + it's bounds. What I suggest is basically struct Constraints{Td, Tb}
c::Td
b::Tb
end where I know where this comes from, I just figured I'd mention it. |
another relevant thing is to consider things like restricting parameters to a Ball for example. In https://github.com/cortner/ConstrainedOptim.jl we had a BallConstraint type used to project back into the ball. |
Great, it seems like we can quickly improve the current interface then 👍 Ah, and BallConstraint projection works better than supplying a constraint |
I guess it can be simpler in some cases, but "better" is sort of a multivalued thing here. |
adding to this, one problem is the existence of the second order differenciable constraints, because that hessian is not of any NDifferentiable type. as my current understanding |
This needs
IPNewtons
we can use?)As a future PR, we should introduce
value!
et al. to theNDifferentiableConstraints
objects as well. But let's deal with that after we have moved IPNewton into Optim.value!
et al. for Constraints