Closed herbelj closed 8 years ago
Thanks for reporting this. Seems like HOPE is not handling the boundaries correctly
import numpy as np
import hope
def interpolation(x, xp, fp):
intp = np.interp(x, xp, fp)
return intp
interpolation_hope = hope.jit(interpolation)
xp = np.arange(5,15)
fp = -xp
x = np.arange(0, 20)
intp = interpolation(x, xp, fp)
intp_hope = interpolation_hope(x, xp, fp)
np.allclose(intp, intp_hope)
@herbelj I modified the bounds checking in the HOPE interp implementation. May I ask you to checkout the interp_bounds
branch and quickly check if this resolves your problem? Thanks
@cosmo-ethz The problem is fixed now, thanks! :)
I found an issue when using the function numpy.interp within a Python function compiled using HOPE. The issue is that interpolation produces different results depending on whether HOPE is used or not. The following example illustrates this.
np.interp_github_issue.pkl.zip