-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Description
🚀 Feature
Don't know if this has been raised before or should be the purpose of this lib, but it would be nice to allow adding constraints for an optimization problem.
Motivation
Some optimization problems take on the form:
while
the constraints don't have an explicit way to implement. One alternative is to write it as a normal loss and give a relatively large
Pitch
Something like the following
objective = th.Objective()
# Add losses
objective.add_loss(loss_function)
...
# Add constraints
objective.add_constraint(constraint_function)
Additional context
The project casadi
has something as
from casadi import Opti
optim = Opti()
optim.subject_to(optim.bounded(lower_bound, x, upper_bound))
Metadata
Metadata
Assignees
Labels
No labels