Skip to content

Final project for the course CMLDA at university of Pisa for the A.Y 2020/2021. In this project we explore the problem of estimating the matrix 2-norm as an unconstrained optimization problem.

Notifications You must be signed in to change notification settings

joetelila/CM-2Norm_matrix_problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CM-2Norm_matrix_problem.

Final project for the course "Computational Mathematics for Learning and Data Analysis" at university of Pisa for the A.Y 2020/2021. In this project we explore the problem of estimating the matrix 2-norm as an uncostrained optimization problem. We used methods "Conjugate Gradient Descent", "Quasi-Newton Method(BFGS)" and "Arnoldi process". All the theoretical analysis of these methods is included in the report.

How to use

Each method can be tested on a jupyter notebook that is placed inside the folder.

Guide CGD

Start by importing necessary functions and classes.

# import
from cgd_funcs import Funcs
from cgd import CGD

Import or generate your matrix and initial vector.

M1 = np.loadtxt('../data/M4.txt')
x0_m1 = np.loadtxt('../data/x0_m4.txt')

Initialize function and and cgd

funcs = Funcs(M1)
# Initialize the CGD algorithm.
cgd = CGD(funcs.func_,funcs.func_grad_,funcs.exact_line_search,x0_m1, 1e-5, 1000, method='FR', verboose=True)

Possible parameters for method parameter for beta

FR for Fletcher-Reeves method
PR for Polak–Ribière method
HS for hessian-free method

Finally start the algorithm

# Run the algorithm.
residual, errors, result = cgd.cgd()

About

Final project for the course CMLDA at university of Pisa for the A.Y 2020/2021. In this project we explore the problem of estimating the matrix 2-norm as an unconstrained optimization problem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •