English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

TorchCurves: A PyTorch Library for Differentiable Parametric Curves

Forum topic · 小凯 · 2026-11-12

Summary

TorchCurves is a new PyTorch library that treats vector-valued parametric curves as learnable primitives in machine learning models. Its core operation maps batches of scalar inputs to points on curves represented in B-spline or Legendre polynomial bases, with differentiation supported through both the inputs and the curve coefficients. Coefficients can be optimized jointly with a surrounding model or generated by another network, enabling applications from continuous feature embeddings to Kolmogorov-Arnold networks (KANs) and functional regression. The library offers trainable modules, reusable basis modules, and a functional interface. Implementation combines classical curve-evaluation algorithms with vectorized PyTorch operations, prioritizing readability and maintainability without custom hardware kernels. Benchmark experiments compare curve evaluation against NumPy/SciPy and KAN training against EfficientKAN, illustrating where the approach is computationally practical and where overhead becomes significant. The paper is available at arXiv:2611.14516, with code at github.com/alexshtf/torchcurves.

Overview

Field: Machine Learning Author: Alex Shtoff Published: 2026-11-10 arXiv: 2611.14516

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 with NumPy/SciPy and KAN training with EfficientKAN, demonstrating in which scenarios this generality is computationally feasible and where the overhead is significant.

Key Takeaways

  • Curves as learnable primitives: B-spline and Legendre polynomial bases with end-to-end differentiability through inputs and coefficients.
  • Flexible integration: coefficients can be trained directly or generated by another neural network.
  • Multiple APIs: trainable modules, reusable basis modules, and a functional interface.
  • Applications: continuous feature embeddings, Kolmogorov-Arnold networks (KANs), functional regression.
  • Pure PyTorch implementation: classical algorithms + vectorized ops, no custom hardware kernels; benchmarks quantify the computational trade-offs.
Code: github.com/alexshtf/torchcurves

Tags

#pytorch#machine-learning#parametric-curves#b-splines#kolmogorov-arnold-networks#differentiable-programming#papers

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178637062