Skip to content

Respect MOI.AutomaticDifferentiationBackend() in NLP #292

Description

@klamike

The current code has SparseReverseMode hard-coded:

"""
_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions