Created
January 28, 2017 01:30
-
-
Save alexbw/b4986ea9dfdd2407530b7a8472572d77 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def f(params,image): | |
h1 = layer1(params,image) | |
h2 = layer2(params,h1) | |
with gradsthru(h2) as gh2: | |
print("Only evaluated in the backwards pass!") | |
print(np.linalg.norm(gh2)) | |
print("Clipping just this gradient!") | |
gh2 = np.clip(gh2,-10,10) | |
return softmax(h2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment