MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / forward

Method forward

AutoML/darts-master/rnn/utils.py:78–84  ·  view source on GitHub ↗
(self, x, dropout=0.5)

Source from the content-addressed store, hash-verified

76 super(LockedDropout, self).__init__()
77
78 def forward(self, x, dropout=0.5):
79 if not self.training or not dropout:
80 return x
81 m = x.data.new(1, x.size(1), x.size(2)).bernoulli_(1 - dropout)
82 mask = Variable(m.div_(1 - dropout), requires_grad=False)
83 mask = mask.expand_as(x)
84 return mask * x
85
86
87def mask2d(B, D, keep_prob, cuda=True):

Callers

nothing calls this directly

Calls 1

newMethod · 0.45

Tested by

no test coverage detected