Created
November 5, 2015 00:37
-
-
Save thearn/faba933208316d71cdb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import autograd.numpy as np | |
from autograd import grad | |
def f(A): | |
B = np.zeros((4,4)) | |
B[:2, :2] = A | |
return B.sum() | |
A = np.random.randn(2,2) | |
df = grad(f) | |
print df(A) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment