You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling to figure out how to use the function gaussian_pdf : mu:arr -> sigma:arr -> arr -> arr in the Owl.Arr module. When I tried the following code in the top level (i.e. OCaml's REPL), it crashes due to a segmentation fault:
#require"owl";;
openOwl;;
let mu_arr =Arr.init [|2|] (fun_ -> 1.);;
Arr.set mu_arr [|1|] 4.;; (* Set the second element of mu_arr to 4. *)let sigma_arr =Arr.init [|2|] (fun_ -> 0.1);;
let current_point =Arr.init [|2|] (fun_ -> 1.5);;
let result_arr =Arr.gaussian_pdf ~mu:mu_arr ~sigma:sigma_arr current_point;;
I managed to figure out how to use gaussian_rvs, but gaussian_pdf still eludes me. Thanks a lot in advance!
The text was updated successfully, but these errors were encountered:
I don't get a segfault but I get nonsensical results (~1E-22). There must be a bug in Arr.gaussian_pdf. The scalar version Stats.gaussian_pdf works fine. I don't have time to chase this now but perhaps @jzstark can take a look?
Hi @ghennequin. It's interesting that you didn't get a segmentation fault. I think the low value in your result (~1E-22) makes sense because I accidentally set sigma to a very low value (0.1) in the above example.
Nonetheless, even if I use a larger (and more reasonable) value for sigma, I still get a segmentation fault. Specifically, the following simpler code produces a segmentation fault:
#require"owl";;
openOwl;;
let mu_arr =Arr.zeros [|2|];;
let sigma_arr =Arr.ones [|2|];;
let current_point =Arr.ones [|2|];;
let result_arr =Arr.gaussian_pdf ~mu:mu_arr ~sigma:sigma_arr current_point;;
I'm struggling to figure out how to use the function
gaussian_pdf : mu:arr -> sigma:arr -> arr -> arr
in theOwl.Arr
module. When I tried the following code in the top level (i.e. OCaml's REPL), it crashes due to a segmentation fault:I managed to figure out how to use
gaussian_rvs
, butgaussian_pdf
still eludes me. Thanks a lot in advance!The text was updated successfully, but these errors were encountered: