Skip to content

Derivative of output with respect to input #1010

Answered by jheek
lweitkamp asked this question in Q&A
Discussion options

You must be logged in to vote

See for example #579

It should look something like this:

def loss_fn(params, input_image):
  return critic.apply(params, input_image)

input_grad = jax.grad(loss_fn, argnums=1)(params, input_image)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lweitkamp
Comment options

Answer selected by lweitkamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants