使用 ensmallen 进行灵活数值优化
Flexible numerical optimization with ensmallen
AI总结:
本文介绍 ensmallen 数值优化库,其提供快速灵活的 C++ 框架,支持多种优化器和目标函数,通过模板元编程实现零开销回调与自动推断,性能优于 Julia 和 SciPy。
摘要:
本报告介绍了 ensmallen 数值优化库,并深入探讨了其工作原理的技术细节。该库提供了一个快速且灵活的 C++ 框架,用于对任意用户提供的函数进行数学优化。它提供了一大批预构建的优化器,包括随机梯度下降和拟牛顿优化器的多种变体。支持多种类型的目标函数,包括可微、可分离、受约束和分类目标函数。实现一个新的优化器仅需一个方法,而一个新的目标函数通常仅需一或两个 C++ 方法。通过内部使用 C++ 模板元编程,ensmallen 支持任意用户提供的回调以及未提供方法的自动推断,且无任何运行时开销。实证比较表明,ensmallen 优于其他优化框架(如 Julia 和 SciPy),有时优势显著。该库可在 https://ensmallen.org 获取,并采用宽松的 BSD 许可证分发。
英文摘要:
This report provides an introduction to the ensmallen numerical optimization library, as well as a deep dive into the technical details of how it works. The library provides a fast and flexible C++ framework for mathematical optimization of arbitrary user-supplied functions. A large set of pre-built optimizers is provided, including many variants of Stochastic Gradient Descent and Quasi-Newton optimizers. Several types of objective functions are supported, including differentiable, separable, constrained, and categorical objective functions. Implementation of a new optimizer requires only one method, while a new objective function requires typically only one or two C++ methods. Through internal use of C++ template metaprogramming, ensmallen provides support for arbitrary user-supplied callbacks and automatic inference of unsupplied methods without any runtime overhead. Empirical comparisons show that ensmallen outperforms other optimization frameworks (such as Julia and SciPy), sometimes by large margins. The library is available at https://ensmallen.org and is distributed under the permissive BSD license.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。