This repository contains Python code for implementing steepest-descent method to optimize a given objective function and visualizing optimization paths with animated contours. Demonstrates two strategies: fixed and optimal step sizes. Includes Fibonacci search for step size and data saved with Pickle.
- Implementation of the steepest-descent method using two different step size strategies: optimal step size and fixed step size.
- The ffunction defines the objective function.
- The Fibonaccifunction calculates Fibonacci numbers, andFibreturns a list of Fibonacci numbers.
- The GD_andGDfunctions implement steepest descent with optimal and fixed step sizes, respectively.
- The script also includes a main block that demonstrates the usage of the implemented methods and saves the optimization path and results to a Pickle file.
- Animated visualization of the steepest descent paths using Matplotlib and NumPy.
- Reads the Pickle file generated by Gradient_Descent.pyto obtain the optimization paths.
- The create_animationfunction generates an animated plot of the optimization process.
- The main block loads the data from the Pickle file, prepares the data for visualization, and saves the animation as a GIF.
- NumPy
- NumDiffTools
- Matplotlib
- 
Ensure that the required dependencies are installed by running: pip install numpy numdifftools matplotlib 
- 
Run Gradient_Descent.pyto perform the steepest-descent optimization and save the results to a Pickle file:python Gradient_Descent.py 
- 
Run main.pyto visualize the steepest-descent paths and generate an animated GIF.python main.py