Do dlgradient and dlfeval have to be used together?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Do dlgradient and dlfeval have to be used together?
function [y,dydx] = rosenbrock(x)
y = 100*(x(2) - x(1).^2).^2 + (1 - x(1)).^2;
dydx = dlgradient(y,x);
end
[y,dydx] = rosenbrock([1,2]),
get error??? Value to differentiate must be a traced dlarray scalar.
Can't it be as convenient as pytorch?”a traced dlarray scalar.“ not clear!!!
0 Kommentare
Antworten (2)
KALYAN ACHARJYA
am 6 Jan. 2020
Bearbeitet: KALYAN ACHARJYA
am 6 Jan. 2020
x=[1,2];
[y,dydx]=rosenbrock(x);
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!