-
Notifications
You must be signed in to change notification settings - Fork 9
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 apply element-wise operator Add #39
Comments
Your problem seems to be caused by automatic broadcasting performed by the addition. You sould be able to solve the problem by manually specifying the dimension along which you want to broadcast the vector.
This way a broadcasting dimension is added as the second dimension and the bias vector should now be broadcast to a matrix of the required shape. Let me know if this worked or if you have further questions. |
Thanks so much for your instruction. My code worked fine! Unfortunately, When I proceed training section, test loss was same value each iterations. // Training
let opt = Optimizers.GradientDescent (loss, mi.ParameterVector, DevHost)
let optFn = mi.Func opt.Minimize |> opt.Use |> arg2 input target
// Set learning rate
let optCfg = {Optimizers.GradientDescent.Cfg.Step=1e-1f}
for itr = 0 to 1000 do
let t = optFn mnist.Trn.All.Input mnist.Trn.All.Target optCfg
if itr % 50 = 0 then
let l = lossFn mnist.Tst.All.Input mnist.Tst.All.Target |> Tensor.value
printfn "Test loss after %5d iterations: %.4f" itr l I got the result:
Please let me know what's wrong about my code. BTW |
Hey kuroyakov, there has been a lot of work going on in the project and unfortunately the docs and code example are a little bit behind right now. I will look over them in the next few days and come back to you as soon as possible. Sebastian |
Hi surban. Thank you for your response and I understand and am proud that you're doing. |
I examined DeepNet sample code referenced by (http://www.deepml.net/model.html)
However, I executed my code and got System.Exception. Additional information was as follows:
The exception occurred at
let hiddenAct = hiddenWeights .* input.T + hiddenBias
I expect
hiddenBias
will be[nHidden; nBatch]
shapes, but[nHidden; nHidden]
.My complete code is as follows:
My environment are as follows:
I'm sorry if I'm misunderstanding about your sophisticated library.
Could you please let me know how to fix this problem?
The text was updated successfully, but these errors were encountered: