Gradient of L2-norm using dlgradient
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
function y = f(x,theta)
y = norm(x-theta, "fro");
end
function [y, dy] = fun_and_deriv(x,theta)
y = f(x,theta);
dy = dlgradient(y,theta);
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!