While real-world problems are often challenging to analyze analytically, deep learning excels in modeling complex processes from data. Existing optimization frameworks like CasADi facilitate seamless usage of solvers but face challenges when integrating learned process models into numerical optimizations. To address this gap, we present the Learning for CasADi (L4CasADi) framework, enabling the seamless integration of PyTorch-learned models with CasADi for efficient and potentially hardware-accelerated numerical optimization. The applicability of L4CasADi is demonstrated with two tutorial examples: First, we optimize a fish's trajectory in a turbulent river for energy efficiency where the turbulent flow is represented by a PyTorch model. Second, we demonstrate how an implicit Neural Radiance Field environment representation can be easily leveraged for optimal control with L4CasADi. L4CasADi, along with examples and documentation, is available under MIT license at https://github.com/Tim-Salzmann/l4casadi
翻译:尽管现实世界的问题通常难以解析分析,但深度学习在从数据中建模复杂过程方面表现出色。现有的优化框架(如 CasADi)便于无缝使用求解器,但在将所学过程模型集成到数值优化中时面临挑战。为弥补这一不足,我们提出了面向 CasADi 的学习(L4CasADi)框架,实现了将 PyTorch 学习模型与 CasADi 无缝集成,从而进行高效且可能硬件加速的数值优化。通过两个教程示例展示了 L4CasADi 的适用性:首先,我们优化了鱼在湍急河流中为追求能效的运动轨迹,其中湍流由 PyTorch 模型表示。其次,我们展示了如何利用隐式神经辐射场环境表示,通过 L4CasADi 轻松实现最优控制。L4CasADi 及其示例和文档可在 MIT 许可下从 https://github.com/Tim-Salzmann/l4casadi 获取。