arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1607.07892cs.MS
收藏

Julia中的前向模式自动微分

Forward-Mode Automatic Differentiation in Julia

Jarrett Revels, Miles Lubin, Theodore Papamarkou

摘要:

我们提出了ForwardDiff,一个Julia包的前向模式自动微分(AD)具有竞争力的性能与低级语言,如C++。与最近在其他流行的高级语言(如Python和MATLAB)中开发的AD工具不同,ForwardDiff利用即时(JIT)编译来透明地重新编译AD未知的用户代码,从而有效支持高阶微分和使用自定义数字类型(包括复数)的微分。对于梯度和雅可比计算,ForwardDiff提供了一种矢量前向模式的变体,可以避免昂贵的堆分配,并比传统矢量模式更好地利用内存带宽。在我们的数值实验中,我们证明了对于非平凡的大尺寸,ForwardDiff的梯度计算可以比基于Python的autograd包的反向模式实现更快。我们还说明了如何在JuMP中有效地使用ForwardDiff,JuMP是一种用于优化的建模语言。根据我们的使用统计,GitHub上有41个独立的存储库依赖于ForwardDiff,用户来自不同的领域,如天文学,优化,有限元分析和统计。本文件是一个扩展摘要,已被接受在AD2016第7届国际药物分化会议上发表。

英文摘要:

We present ForwardDiff, a Julia package for forward-mode automatic differentiation (AD) featuring performance competitive with low-level languages like C++. Unlike recently developed AD tools in other popular high-level languages such as Python and MATLAB, ForwardDiff takes advantage of just-in-time (JIT) compilation to transparently recompile AD-unaware user code, enabling efficient support for higher-order differentiation and differentiation using custom number types (including complex numbers). For gradient and Jacobian calculations, ForwardDiff provides a variant of vector-forward mode that avoids expensive heap allocation and makes better use of memory bandwidth than traditional vector mode. In our numerical experiments, we demonstrate that for nontrivially large dimensions, ForwardDiff's gradient computations can be faster than a reverse-mode implementation from the Python-based autograd package. We also illustrate how ForwardDiff is used effectively within JuMP, a modeling language for optimization. According to our usage statistics, 41 unique repositories on GitHub depend on ForwardDiff, with users from diverse fields such as astronomy, optimization, finite element analysis, and statistics. This document is an extended abstract that has been accepted for presentation at the AD2016 7th International Conference on Algorithmic Differentiation.

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

↑