Tutorials¶
We will walk through two examples using the METOD Algorithm.
Example 1¶
Consider the minimum of several quadratic forms objective function
where \(P\) is the number of minima; \(A_p\) is a random rotation matrix of size \(d\times d\); \(\Sigma_p\) is a diagonal positive definite matrix of size \(d\times d\) with smallest and largest eigenvalues \(\lambda_{min}\) and \(\lambda_{max}\) respectively; \(x_{0p} \in \mathfrak{X}\) and \(p=1,...,P\).
To run the METOD Algorithm in Python for the minimum of several quadratic forms objective function, navigate to the Python examples folder.
In order to run metod_quad_example.py, values for d, seed, P, lambda_1 and lambda_2 will need to be provided.
For example, to set d=50, seed=90, P=5, lambda_1=1 and lambda_2=10, type the following into the command line.
$ python metod_quad_example.py 50 90 5 1 10
All outputs are saved within three csv files and information on all csv files can be found in the table below. All csv files will be stored in the same directory as metod_quad_example.py.
File name |
Description |
|---|---|
discovered_minimizers_d_50_p_5_quad.csv |
All local minimizers found by applying the METOD Algorithm. |
func_vals_discovered_minimizers_d_50_p_5_quad.csv |
Function values at each discovered local minimizer. |
summary_table_d_50_p_5_quad.csv |
Summary table containing the total number of unique local minimizers and repeated local descents to the same local minimizer. |
Example 2¶
Consider the Sum of Gaussians objective function
where \(P\) is the number of Gaussian densities; \(A_p\) is a random rotation matrix of size \(d\times d\); \(\Sigma_p\) is a diagonal positive definite matrix of size \(d\times d\) with smallest and largest eigenvalues \(\lambda_{min}\) and \(\lambda_{max} \); \(c_p\) is a fixed constant and \(p=1,...,P\).
To run the METOD Algorithm in Python for the Sum of Gaussians objective function, navigate to the Python examples folder.
In order to run metod_sog_example.py, values for d, seed, P, sigma_sq, lambda_1 and lambda_2 will need to be provided.
For example, to set d=20, seed=90, P=10, sigma_sq=0.8, lambda_1=1 and lambda_2=10, type the following into the command line.
$ python metod_sog_example.py 20 90 10 0.8 1 10
All outputs are saved within three csv files and information on all csv files can be found in the table below. All csv files will be stored in the same directory as metod_sog_example.py
File name |
Description |
|---|---|
discovered_minimizers_d_20_p_10_sog.csv |
All local minimizers found by applying the METOD Algorithm. |
func_vals_discovered_minimizers_d_20_p_10_sog.csv |
Function values at each discovered local minimizer. |
summary_table_d_20_p_10_sog.csv |
Summary table containing the total number of unique local minimizers and repeated local descents to the same local minimizer. |
Jupyter Notebooks¶
Example 1 and Example 2 are also in the form of Jupyter Notebooks:
METOD Algorithm - Minimum of several quadratic forms.ipynb
METOD Algorithm - Sum of Gaussians.ipynb
Notebooks can be found here. Each Jupyter Notebook contains instructions on how to update parameters and how to run the METOD Algorithm. Similar to Example 1 and Example 2, outputs will be stored within csv files.