Skip to content

Implement 1d interpolation #1140

@jessegrabowski

Description

@jessegrabowski

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions