patrick-kidger / torchcubicspline

Interpolating natural cubic splines. Includes batching, GPU support, support for missing values, evaluating derivatives of the spline, and backpropagation.
Apache License 2.0
198 stars 18 forks source link

How to set the extrapolation strategy #18

Open XDXM147 opened 1 month ago

XDXM147 commented 1 month ago

Hello, when I use this function, if the result falls outside the domain, is the extrapolation result defaulted to returning NaN? I hope to set this extrapolation strategy to a specific numerical value. How do I modify it? I have tried to modify the _interpret_t(self, t) function, but it makes the speed very slow. I hope you can help me solve this problem, thank you very much.

patrick-kidger commented 1 month ago

I'm afraid this isn't something that can be modified in torchcubicspline.

More generally I'm afraid this package is now only in maintenace mode, and won't be accepting new feature requests. This package was only ever quickly making public some code I was playing around with :)