Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
(How) Higher derivative by 'dlgradient' or Higher derivative in matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi
I am currently coding custom deep learning, but the process stopped at the higher derivative.
I am curious about how to make a higher derivative through dlgradient.
Alternatively, you are welcome to suggest a way to do higher derivatives in matlab.
For example, how to get ddydxx in the following example.
clc,clear,close all
x=3;
x0=dlarray(x);
[fval,gradval,ggradval] = dlfeval(@Myfunc,x0);
function [fval,gradval,ggradval] = Myfunc(x)
y = 100*(3*x - 7*x.^2).^2;
dydx=dlgradient(y,x,'RetainData',true);
ddydxx=dlgradient(dydx,x);
end
Error using dlfeval (line 43)
Value to differentiate must be a traced dlarray scalar.
Error in gradtest (line 7)
[fval,gradval,dd] = dlfeval(@Myfunc,x0,y);
Thanks for reading my question.
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!