arrayfire / arrayfire-python

Python bindings for ArrayFire: A general purpose GPU library.

Home Page:https://arrayfire.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bugs in af.approx1()

shyams2 opened this issue · comments

Convergence checks performed on the ArrayFire routines for interpolation seem to indicate a few mistakes:

The following plot is generated using af.INTERP.CUBIC
download 9

The order of convergence comes out to be image, while the expected convergence rate is image. I checked with af.INTERP.CUBIC_SPLINE as well. Even in that case the order of convergence comes out to be image

download 8

Another issue is the fact that the error doesn't drop below 1e-7. The SciPy interpolation function interp1d using cubic interpolation gives this:

download 19

For your reference - this is the code I'd used to generate the plots.

Also regarding issue #130 - I've realised that the mistake was on my part. I should have added the off-set in the indexing to the normalized interpolant points.

@ShyamSS-95 can you check with interpolant_points being the same with arrayfire and scipy ? Right now they are using different random values.

I don't know how much this affects the actual convergance, but that is one difference I see right now.

I've made the changes to the code . I'm querying the interpolant at np.linspace(0, 1, 20) in both the cases. The problem of arrayfire convergence tests not dropping below 1e-7 is no longer present. However, the order of convergence still isn't correct.

download 22

download 21