Skip to content

Expectations for implementations of the interface #13

Closed
@sethaxen

Description

@sethaxen

Is it expected that all packages that implement the interface use AD.@primitive? e.g., ForwardDiff can use DiffResults to enable returning a value and a gradient and/or hessian. In cases like this, what is advised?

I can see a few possibilities:

  1. define @primitive pushforward_function(...) only to keep things simple
  2. define @primitive pushforward_function(...) but then overload methods like value_and_gradient for which the AD package has a more efficient approach.
  3. implement all necessary interface methods by hand

Edit: I'm guessing (2) is the preferred option? For many (most? all?) AD engines, the fallback to working in terms of jacobians will be much less efficient than overloading the corresponding methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designPackage structure and correctnessquestionInquiries and discussions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions