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 件のコメント

Torsten
Torsten 2022 年 5 月 19 日
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.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2022 年 5 月 19 日

コメント済み:

2022 年 5 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by