Minimizing l2 Norm with gradient descent with multiple variables

Hello, im kind of new to matlab. I want to minimize my l2 error with gradient descent. The l2 error depends on two variables g,h which i want to initialize at 0.5 , 0.5. Can someone help me? How do i put my l2-error and steepest gradient descent together?

1 commentaire

Differentiate the l2-error with respect to g and h.
Then -gradient(l2_error) will be the descent direction for the method of steepest descent.
As soon as the distance between two subsequent values X_i = (g_i,h_i) and X_(i+1) = (g_(i+1),h_(i+1)) coming from the formula
X_(i+1) = X_(i) - r*gradient(l2_error)
for a constant r>0 is less than a small number eps chosen by you, stop the algorithm.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Commenté :

le 19 Mai 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by