Skip to content

Poly segfault #690

@ghost

Description

let test_poly () =
  let x = Mat.(uniform 100 1 *$ 9.) in
  let y = Mat.(sin x + (gaussian ~sigma:0.1 100 1)) in
  let n = 4 in
  let p = Regression.D.poly x y n in
  let z = Array.init (n + 1) (fun i -> Mat.(pow_scalar x (float_of_int i)))
    |> Mat.concatenate ~axis:1
  in
  Mat.(z *@ p)

Running this example always leads to a segfault for me if I increase n any higher than 2.
I took this example from the examples directory in this repo.
I am runnning owl 1.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions