From 77a96cfc01ca37abddb74e396f9d597e8ac94c68 Mon Sep 17 00:00:00 2001 From: Matt Graham Date: Wed, 9 Nov 2016 19:55:11 +0000 Subject: [PATCH] Fixing use of global rng in DropoutLayer fprop. --- mlp/layers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlp/layers.py b/mlp/layers.py index 50d3d6a..d8af0d7 100644 --- a/mlp/layers.py +++ b/mlp/layers.py @@ -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