logistic回归中w和b为什么能0初始化

Ng说的是神经网络不能零初始化,而这个例子只是logistic回归,它没有隐藏层,所以不算是神经网络,且Ng在教学视频的第一部分『神经网络与深度学习』中的第二周里的「梯度下降法」中的2分38秒时明确说了,logistic回归的权值初始化可以是任意初始化方法,包括全0初始化。同时,Ng在教学视频的『神经网络与深度学习』中第四周的『随机初始化』中开篇又强调了这一点,并且又用这个视频来解释了为什么神经网络权重不能初始化为0。
那为什么logistic回归可以全0初始化呢?对于这个问题,Ng特意在该次作业的下一次,也就是第3周的第一次测验中的第7题来回答了这个问题,具体为:

Logistic Regression doesn’t have a hidden layer. If you initialize the weights to zeros, the first example x fed in the logistic regression will output zero but the derivatives of the Logistic Regression depend on the input x (because there’s no hidden layer) which is not zero. So at the second iteration, the weights values follow x’s distribution and are different from each other if x is not a constant vector.
翻译为:Logistic回归没有隐藏层。 如果将权重初始化为零,则Logistic回归中的第一个示例x将输出零,但Logistic回归的导数取决于不是零的输入x(因为没有隐藏层)。 因此,在第二次迭代中,如果x不是常量向量,则权值遵循x的分布并且彼此不同。

发布了7 篇原创文章 · 获赞 0 · 访问量 988

猜你喜欢

转载自blog.csdn.net/qq_36814762/article/details/102469333
今日推荐