Created
June 27, 2020 11:16
-
-
Save svenkreiss/81c5815774f0768887432b38f73ed983 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
class GradScale100(torch.autograd.Function): | |
@staticmethod | |
def forward(ctx, input): | |
return input | |
@staticmethod | |
def backward(ctx, grad_output): | |
return grad_output * 0.01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use:
logb = GradScale100.apply(self.logb)