Link Search Close Search Menu Expand Document

Gradient Descent Animation

Figure 1: Gradient Descent on a convex function



In Gradient Descent example we saw how we can minimize a function. If we want to show the animation of gradient descent we can write the program as below.

Below program uses matplotlib and FuncAnimation to show the animation.

At each iteration of gradient descent, we store the values of (x, y) in a list. In animation function we iterate this list to show the animation.

Implementation of Gradient Descent with animation



Back to top

Copyright © 2020-2021 Gajanan Bhat. All rights reserved.