Summaries for machine learning course (4)

Checking gradient descent for convergence: There are two ways to check whether the gradient descent is working correctly: 1. A graph of the learning curve: If gradient descent is working correctly, the cost J should decrease with each iteration. If J increases, it usually means the learning rate α is too high or there’s a bug in the code. By around 300 iterations, the cost curve starts to level off, and by 400 iterations, it flattens out. This shows that gradient descent has mostly converged, as the cost is no longer decreasing significantly. For a different application, gradient descent might require 1,000 or even 100,000 iterations to converge. Predicting the exact number of iterations needed in advance is often challenging. 2. Automatic convergence test: Disadvantage: Choosing an appropriate threshold ( ϵ \epsilon ϵ ) is not straightforward. If ϵ \epsilon ϵ is too small, the algorithm may run unnecessarily long, wasting computational resources. If it’s too large,...