TorchCurves: Differentiable Parametric Curves
Alex Shtoff
Abstract
We present TorchCurves, a PyTorch library that treats vector-valued parametric curves as learnable primitives. Its central operation maps batches of scalar inputs to points on curves represented in B-spline or Legendre polynomial bases, with differentiation through both inputs and coefficients. Curve coefficients can be optimized jointly with the surrounding model or produced by another network. The library provides trainable modules, reusable basis modules, and a functional interface, supporting applications ranging from continuous feature embeddings to Kolmogorov-Arnold networks and functional regression. Its implementation combines classical evaluation algorithms with vectorized PyTorch operations, emphasizing readability and maintainability without custom hardware kernels. Timing experiments compare curve evaluation against NumPy and SciPy and KAN training against EfficientKAN across a range of problem sizes. The results illustrate where this generality remains computationally practical and where overhead is substantial. Library is available on GitHub at https://github.com/alexshtf/torchcurves.
Create a lesson
Related papers
Bio-PM-Guided Synthetic IMU Generation
Deepali Singh, Deepesh Parpani, Aviral Gupta
Active Feature Acquisition by Distilling an Oracle Teacher
Yang Meng, Zixin Ding, Robert L. Grossman et al.
The Window Lever: Longer Observation Windows Outweigh the Observed Effects of Data, Capacity, and Architecture in Customer Behavior Forecasting
Tara Sowrirajan, Yanqiao Wang
Hybrid Retrieval for Government Scheme Search in English and Marathi
Aishwarya Gunjal, Kanchan Khemnar, Pawan Poojary et al.
Grid Cells as Spectral Successor Features: A Reusable Basis for Continual Reinforcement Learning
Élodie Côté-Gauthier, Doina Precup, Isabeau Prémont-Schwarz
A new algorithmic approach for finding flat minima: critically damped Polyak stepsizes
Francesco Caporali, Jason M. Altschuler, Boris Hanin