-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 Dimension Only? #4
Comments
Depends what you mean! The first example in the README considers three different dimensions (=channels) at the same time: import torch
from torchcubicspline import(natural_cubic_spline_coeffs,
NaturalCubicSpline)
length, channels = 7, 3
t = torch.linspace(0, 1, length)
x = torch.rand(length, channels)
coeffs = natural_cubic_spline_coeffs(t, x)
spline = NaturalCubicSpline(coeffs)
point = torch.tensor(0.4)
out = spline.evaluate(point) If you mean that you want to have multiple "lengths", then I'm afraid not. (Good ways of doing splines isn't even a solved problem in that context.) Does that answer your question? |
Hi, Patrick Kidger, Thanks for sharing! x = np.linspace(-3, 3, 100) # non regular grids X,Y, Z = np.meshgrid(x,y,z,indexing='ij') interp = custom_Interp3D_algorithm((x,y,z), values) // sample points Once can also wrap this into BXCXHXW tensor, where HX W is the 2d grid. Yancong |
Hi @yanconglin - I'm afraid not, is the short answer. Producing higher-dimensional interpolants, on irregular data, is much harder than the 1D case. Methods for doing so are much less standard than in the 1D case. |
Hi I wonder if this code works for 2 or 3 dimensional data!
Thanks.
The text was updated successfully, but these errors were encountered: