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

Add second order derivative #8

Closed mossjacob closed 3 years ago

mossjacob commented 3 years ago

Cubic splines are twice continuously differentiable. This PR adds support for the second derivative.

mossjacob commented 3 years ago

aaand i've just seen there is another PR for this! Can either close this one or I'm happy to make the changes that were desired by Patrick in the other PR. let me know :)

patrick-kidger commented 3 years ago

This PR is a lot more complete than the other one, and looks good as-is. Thanks for contributing.

The only thing this PR doesn't have is high-order derivatives, but I'm not too fussed about that unless someone comes asking for them, as the derivatives become discontinuous i.e. FTC no longer holds.

mossjacob commented 3 years ago

Pleasure, and thanks for making this package in the first place!