【机器学习】-Week5.5 Random Initialization

Initializing all theta weights to zero does not work with neural networks. When we backpropagate, all nodes will update to the same value repeatedly. Instead we can randomly initialize our weights for our Θ matrices using the following method:

Hence, we initialize each Θ(l)ij to a random value between[−ϵ,ϵ]. Using the above formula guarantees that we get the desired bound. The same procedure applies to all the Θ's. Below is some working code you could use to experiment.

rand(x,y) is just a function in octave that will initialize a matrix of random real numbers between 0 and 1.

(Note: the epsilon used above is unrelated to the epsilon from Gradient Checking)


来源:coursera 斯坦福 吴恩达 机器学习

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 12,357评论 3 20
  • 我们热爱生活,热爱生活的阳光和阴雨。 爱情是什么? 爱你就是爱我自己,伤害你就等于伤害我,我今天才明白,为什么会有...
    黄玉翠阅读 665评论 0 0
  • 与聪明人说话,要依靠旁征博引;与笨拙的人说话,要依靠高谈雄辩;与善辩的人说话,要依靠简明扼要;与高贵的人说话,要依...
    初静_5633阅读 183评论 0 0
  • 有那么些朋友她的朋友圈很小,我知道知心的可能就我自己 那一年和她一起考上了大学,我们有了自己彼此的朋友圈 那一年我...
    糖笔醉心阅读 343评论 0 0
  • 金灿灿,闪闪发光 你可曾发现 发现 这闪光的亲情 浓浓的亲情 有着父母无私的 有着姐妹深情的 有着常人没有的 有着...
    创新造型阅读 263评论 0 2