-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot take derivative of a scalar function #106
Comments
This turned out to be tough nut to crack: it has to do with broadcast multiplying a Result{Array} with an Array{Any} that has Result's in it. I am not sure this code does anything useful but it certainly proved useful as a test case. @ekinakyurek where did you find this code and what is it supposed to compute? |
This the forward part of my code for calculating gradients via backslash. I
was just trying to benchmark it with AutoGrad, then I got this message.
…On Sat, Jan 5, 2019 at 5:16 AM denizyuret ***@***.***> wrote:
This turned out to be tough nut to crack: it has to do with broadcast
multiplying a Result{Array} with an Array{Any} that has Result's in it. I
am not sure this code does anything useful but it certainly proved useful
as a test case. @ekinakyurek <https://github.com/ekinakyurek> where did
you find this code and what is it supposed to compute?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#106 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOpr8YTMIDT47N_U1RMCMVRBlaVbVbC6ks5vAAsKgaJpZM4ZcNZ_>
.
|
I am not sure if that is exactly the same problem, but gives "AssertionError: Only scalar valued functions supported." with the code below.
|
The plot of F(t) runs. But Fd(t) can not run. using Knet, Plots t=0:0.1:2*3.14 |
To take the grad of F, F should return a scalar value. Then you can apply broadcasted version of both F and Fd on t. using Knet, Plots
F(t) = sin(t)
Fd = grad(F)
t=0:0.1:2*3.14
plot(F.(t))
plot(Fd.(t)) |
Thank you very much Ozan. |
See denizyuret/Knet.jl#410
The text was updated successfully, but these errors were encountered: