Last active
October 31, 2017 22:46
-
-
Save yaroslavvb2/53a62551e690b72108495252b9f9177a 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
# expensive way to compute factorial of n | |
def factorial(n): | |
def f(x): | |
return tf.pow(x, n) | |
for i in range(n): | |
f = tfe.gradients_function(f) | |
return f(1.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment