-
Notifications
You must be signed in to change notification settings - Fork 120
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
Invalid_argument("index out of bounds") with Algodiff #623
Comments
I'm not entirely sure if this is the issue, but I think it might have to do with |
That doesn't help: utop # #require "owl-top";;
utop # open Owl
module AD = Owl.Algodiff.D
let a = AD.Arr (Arr.zeros [| 1; 1 |])
let b = AD.make_reverse (AD.Arr (Arr.zeros [| 1 |])) (AD.tag ())
let () =
let x = AD.Maths.(a + b) in
AD.Mat.print x;
AD.reverse_prop (Arr (Arr.ones [| 1 |])) x;
AD.Mat.print (AD.adjval b);;
C0
R0 0
Exception: Invalid_argument "index out of bounds". Anyway, I can fix this myself by extending |
By mistake, I just found out that it does not fail the second time... Try this try AD.reverse_prop (Arr (Arr.ones [| 1 |])) x with e -> AD.reverse_prop (Arr (Arr.ones [| 1 |])) x; or try AD.reverse_prop (F 1.) x with e -> AD.reverse_prop (F 1.) x; and it will return unit fine 😮 |
This program adds two arrays together using Algodiff:
It fails at the
reverse_prop
step with:I assume that since the forwards part works, the reverse step should work too. I guess it's something to do with the shape of
b
. If I use[|1; 1|]
then it works.The text was updated successfully, but these errors were encountered: