Skip to content

Conversation

@LBJyang
Copy link

@LBJyang LBJyang commented Nov 30, 2025

截屏2025-11-30 10 24 20 In the original document, after plotting with the plt_divergence function, the graph appears to diverge from the bottom of the figure. However, in reality, if the starting point is (200, 100), this position corresponds to the minimum cost point, where the derivative of the cost function is zero, so no such divergence should occur. Upon closer inspection, this effect is caused by an overly large coordinate range.

By setting the learning rate to 0.6, it is possible to illustrate the divergence of the cost function due to an excessively large learning rate, while keeping the coordinate system relatively small for a clear visual presentation.

The main adjustments made in this revision are the coordinate range and the learning rate. Additionally, to clearly show the starting point where the cost function begins to diverge, the original point has been added to p_history and J_history in the gradient_descent function.

These modifications, compared to the original version, better demonstrate the nature of divergence without causing confusion and align with the lecture slides provided by the instructor.
截屏2025-11-30 10 33 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant