arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2511.18157cs.LGcs.RO
收藏

scipy.spatial.transform: 可微框架无关的Python三维变换

scipy.spatial.transform: Differentiable Framework-Agnostic 3D Transformations in Python

Technical University of Munich(慕尼黑技术大学)

Martin Schuck, Alexander von Rohr, Angela P. Schoellig

AI总结:

scipy.spatial.transform通过兼容多种数组库,为可微系统和ML提供框架无关的三维空间数学基础。

摘要:

三维刚体变换,即旋转和翻译,是现代可微机器学习管道在机器人学、视觉和模拟中的核心要素。然而,由于轴约定、规范化、组合一致性以及仅在边缘情况才会出现的细微错误,数值稳健且数学正确的实现具有较高的错误风险。SciPy的spatial.transform模块是一个经过严格测试的Python实现。然而,它历史上只支持NumPy,限制了在GPU加速和自动微分工作流中的采用。我们提出了对SciPy的spatial.transform功能的全面 overhaul,使其能够与任何实现Python数组API的数组库兼容,包括JAX、PyTorch和CuPy。修订的实现保留了已建立的SciPy接口,同时支持GPU/TPU执行、JIT编译、向量化批处理以及通过所选后端的原生自动微分。我们通过两个案例研究展示了这一基础如何支持可微科学计算:(i) 三维变换和旋转的可扩展性以及(ii) 一个利用SciPy的Rotation进行精确旋转动力学积分的JAX无人机模拟。我们的贡献已合并到SciPy主分支,并将在下一次发布中提供,为可微系统和ML中的三维空间数学提供一个框架无关、生产级的基础。

英文摘要:

Three-dimensional rigid-body transforms, i.e. rotations and translations, are central to modern differentiable machine learning pipelines in robotics, vision, and simulation. However, numerically robust and mathematically correct implementations, particularly on SO(3), are error-prone due to issues such as axis conventions, normalizations, composition consistency and subtle errors that only appear in edge cases. SciPy's spatial$.$transform module is a rigorously tested Python implementation. However, it historically only supported NumPy, limiting adoption in GPU-accelerated and autodiff-based workflows. We present a complete overhaul of SciPy's spatial$.$transform functionality that makes it compatible with any array library implementing the Python array API, including JAX, PyTorch, and CuPy. The revised implementation preserves the established SciPy interface while enabling GPU/TPU execution, JIT compilation, vectorized batching, and differentiation via native autodiff of the chosen backend. We demonstrate how this foundation supports differentiable scientific computing through two case studies: (i) scalability of 3D transforms and rotations and (ii) a JAX drone simulation that leverages SciPy's Rotation for accurate integration of rotational dynamics. Our contributions have been merged into SciPy main and will ship in the next release, providing a framework-agnostic, production-grade basis for 3D spatial math in differentiable systems and ML.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑