TorchCurves
A PyTorch-based differentiable parametric curve library that implements parametric curves under B-spline and Legendre polynomial bases as trainable modules, supporting applications such as continuous feature embedding, KAN, and function regression.
Timeline (last 90 days)
TorchCurves is a PyTorch library that implements parametric curves under B-spline and Legendre polynomial bases as differentiable modules, enabling curve coefficients to be optimized like neural network weights.
The central operation of TorchCurves is to map a batch of scalar inputs to points on a curve, with the forward computation differentiable with respect to both the inputs and the curve coefficients.
TorchCurves provides three types of interfaces: trainable modules, reusable basis modules, and a functional interface.
TorchCurves is suitable for scenarios such as continuous feature embedding, Kolmogorov-Arnold networks (KAN), and function regression.
The edge functions of a KAN are essentially learnable univariate curves, and TorchCurves can provide a replaceable curve evaluation backend for them.
TorchCurves emphasizes readability and maintainability, and rather than writing custom hardware kernels (such as CUDA, Triton, or C++ extensions), it uses purely vectorized PyTorch operations.
At extreme scales, TorchCurves incurs additional overhead from using general-purpose PyTorch operators and is not suitable for production inference that pursues extreme throughput.
The authors conducted two sets of timing experiments: one comparing curve evaluation against NumPy and SciPy, and the other comparing KAN training against EfficientKAN at different problem scales; the conclusions are qualitative and no specific speedup ratios or absolute times are given.
TorchCurves is open-sourced on GitHub at github.com/alexshtf/torchcurves.
All Facts (8)
TorchCurves is a PyTorch library that implements parametric curves under B-spline and Legendre polynomial bases as differentiable modules, enabling curve coefficients to be optimized like neural network weights.
50%UnverifiedThe central operation of TorchCurves is to map a batch of scalar inputs to points on a curve, with the forward computation differentiable with respect to both the inputs and the curve coefficients.
50%UnverifiedTorchCurves provides three types of interfaces: trainable modules, reusable basis modules, and a functional interface.
50%UnverifiedTorchCurves is suitable for scenarios such as continuous feature embedding, Kolmogorov-Arnold networks (KAN), and function regression.
50%UnverifiedThe edge functions of a KAN are essentially learnable univariate curves, and TorchCurves can provide a replaceable curve evaluation backend for them.
50%UnverifiedTorchCurves emphasizes readability and maintainability, and rather than writing custom hardware kernels (such as CUDA, Triton, or C++ extensions), it uses purely vectorized PyTorch operations.
50%UnverifiedAt extreme scales, TorchCurves incurs additional overhead from using general-purpose PyTorch operators and is not suitable for production inference that pursues extreme throughput.
50%UnverifiedThe authors conducted two sets of timing experiments: one comparing curve evaluation against NumPy and SciPy, and the other comparing KAN training against EfficientKAN at different problem scales; the conclusions are qualitative and no specific speedup ratios or absolute times are given.
50%