Fixing use of global rng in DropoutLayer fprop.

This commit is contained in:
Matt Graham 2016-11-09 19:55:11 +00:00
parent 9c86d00078
commit 77a96cfc01

View File

@ -577,7 +577,7 @@ class DropoutLayer(StochasticLayer):
if stochastic:
mask_shape = ((1,) + inputs.shape[1:] if self.share_across_batch
else inputs.shape)
self._mask = (rng.uniform(size=mask_shape) < self.incl_prob)
self._mask = (self.rng.uniform(size=mask_shape) < self.incl_prob)
return inputs * self._mask
else:
return inputs * self.incl_prob