Created
November 24, 2017 00:01
-
-
Save cjratcliff/f226db30a2526bb540f5f2387e249bf7 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
@tf.RegisterGradient("CustomRelu") | |
def _custom_relu_grad(op, grad): | |
#return gen_nn_ops._relu_grad(grad, op.outputs[0]) | |
return tf.where(tf.greater(op.outputs[0],0.0),grad,tf.zeros_like(grad)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment