This folder contains the interactive animations for the different concepts covered in the ALADA course. The animations are created using the matplotlib
library in Python. All interaction with these animations is done through the keyboard.
You will need Python 3.9 or higher. The best thing to do is to install Anaconda and create a new environment. You can do this by running the following commands in your terminal:
conda env create -f alada.yml
This will create a new environment called alada
with all the necessary packages. You can then activate the environment by running:
conda activate alada
You should now be able to run the different scripts to open the animations and interact with them.
The following animations are available for the continuous optimization section:
-
Univariate Gradient Descent:
univar_graddesc_stepsize.py
Demonstration of the effect of step size using a quadrating function$f(x) = x^2$ . -
Univariate Newton's Method:
univar_func1_newton.py
Demonstration of Newton's method using an arbitrary function$f(x)$ . -
Univariate Secant Method:
univar_func1_secant.py
Demonstration of the Secant method using an arbitrary function$f(x)$ . -
Univariate Newton's Method:
univar_func2_newton.py
Demonstration where Newton's method can fail. The function used is$f(x) = 1 - \exp\left(-\frac{x^2}{4}\right)$ . -
Univariate Levenberg-Marquardt Method:
univar_func1_newton_lm.py
Demonstration where Newton's method can fail, while the Levenberg-Marquart works for the appropriate choice of$\lambda$ . The function used is$f(x) = 1 - \exp\left(-\frac{x^2}{4}\right)$ . -
Multivariate function and its variation along a direction:
multivar_directional_plot.py
Demonstration of a multivariate function and its variation along its gradient and another arbitrary direction. -
Multivariate Gradient Descent with Backtracking:
multivar_graddesc_backtracking.py
Demonstration of the effect of backtracking line search on the convergence of the gradient descent algorithm. -
Multivariate Optimization with different Methods:
multivar_methods.py
Demonstration of the gradient descent (fixed step size), Newton's Method, and Levenberg-Marquardt method on a multivariate function. -
Multivariate Optimization with Steepest Descent:
multivar_steepdesc.py
Demonstration of the steepest descent method on a multivariate function.