We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for posting this. However I found you can make things much faster by using the gpu for generating your random numbers as below:
class GaussianDropout(nn.Module): def __init__(self, alpha=1.0): super(GaussianDropout, self).__init__() self.alpha = torch.cuda.FloatTensor([alpha]) def forward(self, x): """ Sample noise e ~ N(1, alpha) Multiply noise h = h_ * e """ if self.train(): epsilon = torch.cuda.FloatTensor(*x.size()).normal_() * self.alpha + 1 epsilon = Variable(epsilon) return x * epsilon else: return x
The text was updated successfully, but these errors were encountered:
Thanks! I will merge PR if you make one :)
Sorry, something went wrong.
No branches or pull requests
Thanks for posting this. However I found you can make things much faster by using the gpu for generating your random numbers as below:
The text was updated successfully, but these errors were encountered: