Skip to content
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

Generalize compute_gradient #428

Open
jrmaddison opened this issue Nov 2, 2023 · 1 comment
Open

Generalize compute_gradient #428

jrmaddison opened this issue Nov 2, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jrmaddison
Copy link
Collaborator

jrmaddison commented Nov 2, 2023

Just as a tangent-linear computes a general directional derivative (a JAX jvp) the adjoint computes a (conjugate) derivative of a general dual element evaluation (the conjugate of a JAX vjp).

For a state $u \in V$ the generalization is defined by a functional

$J (u) = \eta (u)$,

for some $\eta \in V^*$, and the adjoint then computes (the conjugate of) the derivative of the reduced functional $\hat{J} = J \circ \hat{u}$ where $\hat{u}$ defines the forward (mapping from the control to the state).

compute_gradient is currently the case where $u$ is a scalar-valued output and $\eta$ is the identity.

This is already possible using InnerProduct or DotProduct to define the functional, and this is already used for the Gauss-Newton approximation. A simple interface could be added, and a new marker might be added to allow $\eta$ to be changed without re-evaluating the forward.

@jrmaddison jrmaddison added the enhancement New feature or request label Nov 2, 2023
@jrmaddison
Copy link
Collaborator Author

AdjointActionMarker introduced in #542 could be used for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant