-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
The current code has SparseReverseMode hard-coded:
DiffOpt.jl/src/NonLinearProgram/nlp_utilities.jl
Lines 94 to 109 in bf2c4c3
| """ | |
| _create_evaluator(form::Form) | |
| Create the evaluator for the NLP. | |
| """ | |
| function _create_evaluator(form::Form) | |
| nlp = form.model | |
| backend = MOI.Nonlinear.SparseReverseMode() | |
| evaluator = MOI.Nonlinear.Evaluator( | |
| nlp, | |
| backend, | |
| MOI.VariableIndex.(1:form.num_variables), | |
| ) | |
| MOI.initialize(evaluator, [:Hess, :Jac]) | |
| return evaluator | |
| end |
Perhaps backend should be set based on MOI.AutomaticDifferentiationBackend()? Besides the SymbolicMode, it would also allow to use DiffOpt with custom evaluators.
andrewrosemberg and joaquimg
Metadata
Metadata
Assignees
Labels
No labels