【发布时间】:2016-04-03 04:03:04
【问题描述】:
我正在训练一个简单的前馈模型,其中包含 3 或 4 个隐藏层,并且每个(隐藏层 + 非线性)组合之间存在 dropout。 有时在几个 epoch(大约 10-11)之后,模型开始输出 Infs 和 NaNs 作为 NLL 的误差,并且准确度下降到 0.0%。当我不使用 dropout 时,不会发生此问题。这是 Theano 中辍学的一个已知问题吗?我实现 dropouts 的方式是:
def drop(self, input):
mask = self.theano_rng.binomial(n=1, p=self.p, size=input.shape, dtype=theano.config.floatX)
return input * mask
其中 input 是我们想要应用 dropout 的特征向量。 我还观察到,如果辍学概率 (self.p) 更高,NaN 的出现会更早发生。 p = 0.5 会导致 NaN 出现在 epoch 1 或 2 左右,但 p = 0.7 会导致 NaN 出现在 epoch 10 或 11 左右。 此外,仅当隐藏层大小很大时才会出现 NaN。例如 (800,700,700) 给出 NaN,而 (500,500,500) 则没有。
【问题讨论】:
标签: python theano deep-learning