Skip to content

Instantly share code, notes, and snippets.

@aussetg
Created March 10, 2021 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aussetg/834c7146b255d4924f931a0d50a60806 to your computer and use it in GitHub Desktop.
Save aussetg/834c7146b255d4924f931a0d50a60806 to your computer and use it in GitHub Desktop.
using DiffEqFlux
using Zygote
nn = FastChain((x,p) -> p)
p = rand(2, 2)
x = rand(1, 100)
function f(p)
gz, back = Zygote.pullback(z -> nn(z, p), x)
back(gz)[1]
end
y, back = Zygote.pullback(f, p)
back(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment