arrayfire / arrayfire/arrayfire-python

Bugs in af.approx1()

Đang mở
#135 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
422
Fork
63
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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](https://cloud.githubusercontent.com/assets/19583419/24001222/90a839b2-0a83-11e7-8d61-dac9f4fd45a3.png)

The order of convergence comes out to be ![image](https://cloud.githubusercontent.com/assets/19583419/24001620/abd1cd74-0a84-11e7-8690-c6f68882734f.png), while the expected convergence rate is ![image](https://cloud.githubusercontent.com/assets/19583419/24001712/dffcefd4-0a84-11e7-99d5-6475b2de7c79.png). I checked with `af.INTERP.CUBIC_SPLINE` as well. Even in that case the order of convergence comes out to be ![image](https://cloud.githubusercontent.com/assets/19583419/24001738/fa04291a-0a84-11e7-8fcb-946a8b3e8602.png)

![download 8](https://cloud.githubusercontent.com/assets/19583419/24001789/174c4f2a-0a85-11e7-8af0-582a153b6123.png)

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](https://cloud.githubusercontent.com/assets/19583419/24001909/4fb536f6-0a85-11e7-8339-16767b8bd4eb.png)

For your reference - this is the [code](https://gist.github.com/ShyamSS-95/ad0065e984b76d1ccaecc5e21b425734) 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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by running the linked reproduction code and examining af.approx1 with af.INTERP.CUBIC and af.INTERP.CUBIC_SPLINE. Compare the observed convergence rates and error floor with SciPy's interp1d; done means identifying and correcting the interpolation behavior so the expected convergence and accuracy are restored.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.