0% found this document useful (0 votes)
13 views

A1

The assignment for CS1.404 requires students to implement various optimization algorithms in Python without using built-in libraries that solve the problems directly. Students must submit their code along with a report detailing derivations, convergence analysis, and visualizations. Plagiarism is strictly prohibited, and specific submission formats must be followed, including a compressed folder with all necessary files.

Uploaded by

Tathagata Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

A1

The assignment for CS1.404 requires students to implement various optimization algorithms in Python without using built-in libraries that solve the problems directly. Students must submit their code along with a report detailing derivations, convergence analysis, and visualizations. Plagiarism is strictly prohibited, and specific submission formats must be followed, including a compressed folder with all necessary files.

Uploaded by

Tathagata Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

CS1.

404 (Spring 2025)


Optimization Methods
Assignment 1
Deadline: 11:55 PM, March 21st, 2025

Instructions
1. Attempting all questions is mandatory.

2. You are expected to solve all the questions using the Python programming lan-
guage.

3. Use of any in-built libraries that directly solve the problem is not allowed.

4. Submission Format: Check assignment description or announcement post for de-


tails.

5. Plagiarism is strictly prohibited. All code will be checked for plagiarism. Any
copied code or suspicious similarity will result in an F grade.

6. If any two students submit the exact same code, both get an F grade.

1 Functions

1.1 Trid Function


d
X d
X
2
f (x) = (xi − 1) − xi−1 xi
i=1 i=2

1.2 Three Hump Camel


x61
f (x) = 2x21 − 1.05 x41 + + x1 x2 + x22
6

1.3 Styblinski-Tang Function


d
1X 4
xi − 16 x2i + 5 xi

f (x) =
2 i=1

1
1.4 Rosenbrock Function
d−1 h i
X 2
f (x) = 100 xi+1 − x2i + (xi − 1) 2

i=1

1.5 Root of Square Function


q q
f (x) = 1+ x21 + 1 + x22

2 Steepest Descent
Implement the Steepest Descent algorithm using inexact line search. For both the algo-
rithms, use the following stopping condition: Terminate the algorithm when the magni-
tude of gradient is less than 10−6 or after 104 iterations.

2.1 Backtracking with Armijo Condition

Figure 1: Armijo Condition

2
2.2 Backtracking with Armijo-Goldstein Condition

Figure 2: Armijo-Goldstein Condition

2.3 Bisection Method with Wolfe Condition

Figure 3: Wolfe Condition

3 Newton’s Method
Implement the following variants of Newton’s Method. Use the following stop- ping
condition- Terminate the algorithm when the magnitude of gradient is less than 10−6 or
after 104 iterations.

3
3.1 Pure Newton’s Method

Figure 4: Pure Newton

3.2 Damped Newton’s Method


Set α = 0.001 and β = 0.75.

Figure 5: Damped Newton

4
3.3 Levenberg-Marquardt Modification

Figure 6: Levenberg-Marquardt

5
3.4 Combining Damped Newton’s Method with Levenberg-Marquardt

Figure 7: Combined

4 Submission Instructions

4.1 Allowed Packages


1. Python 3.11

2. NumPy

3. Matplotlib

4. PrettyTables

4.2 Boiler Plate


You have been provided three files:

• algos.py: Where you must implement all the algorithms.

• functions.py: Contains all the functions used for testing.

• main.py: The file to be executed to test your code.

6
You are not allowed to create additional files nor modify main.py and functions.py for
the final submission. In algos.py you may create new helper functions if needed.

4.3 Report
You are required to submit a Report (as a PDF) that includes:

1. Derivations of the Jacobians and Hessians for all the functions.

2. Using those Jacobians and Hessians, manually compute the minima for all functions
except Rosenbrock.

3. Mention which algorithms failed to converge (if any) and under what circumstances.

4. Plot f (x) vs. iterations and ∥∇f (x)∥ vs. iterations.

5. Make a contour plot with arrows indicating the update directions for all 2D func-
tions.

4.4 Submission Format


• Create a folder named with your Roll Number, containing:

– algos.py
– functions.py
– main.py
– Report.pdf

• Compress the folder into RollNo.zip. For example: 2021112011.zip.

You might also like