Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 1d interpolation #1140

Closed
jessegrabowski opened this issue Dec 28, 2024 · 1 comment · Fixed by #1141
Closed

Implement 1d interpolation #1140

jessegrabowski opened this issue Dec 28, 2024 · 1 comment · Fixed by #1141

Comments

@jessegrabowski
Copy link
Member

Description

Pytensor doesn't have a an equivalent of np.interp or scipy.interpolate.interp1d. This is related to pymc-devs/pymc#6838, which asks for a spline implementation in PyMC. We could eventually build up to that, but I think some simple cases (linear, nearest, first, last, mean) would be useful as a first pass.

I envision that this will essentially be an OpFromGraph constructor. The user will pass in input/output vectors, and get back a vectorized function that evaluates new inputs. I personally like this better than the np.interpolate signature that takes everything in one go. It will also play somewhat nicer with shared variables, since it's obvious how to split out the input/output that is interpolated over (which I assume shouldn't change between train and test time) and the input data to evaluate on (which presumably will).

@ricardoV94
Copy link
Member

ricardoV94 commented Dec 28, 2024

I would suggest providing something with the same signature as numpy even if there's a primitive with another name with the alternative signature used internally.

So users don't have to guess the API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants