Created
November 7, 2015 00:10
-
-
Save diogo149/6893b83409ae4575e2bd to your computer and use it in GitHub Desktop.
Gradient Reversal in Theano
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
from theano.compile import ViewOp | |
class GradientReversalOp(ViewOp): | |
def grad(self, inputs, output_gradients): | |
return [-output_gradients[0]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment