Gradient descent algorithm won't converge

前端 未结 6 1145
轻奢々
轻奢々 2021-02-06 05:42

I\'m trying to write out a bit of code for the gradient descent algorithm explained in the Stanford Machine Learning lecture (lecture 2 at around 25:00). Below is the implementa

6条回答
  •  無奈伤痛
    2021-02-06 06:31

    Your implementation is good. Generally, stochastic gradient descent might diverge when α is too large. What you would do with a large dataset is take a reasonably sized random sample, find α that gives you the best results, and then use it for the rest.

提交回复
热议问题