首页> 外文期刊>Journal of Functional Programming >Perturbation confusion in forward automatic differentiation of higher-order functions
【24h】

Perturbation confusion in forward automatic differentiation of higher-order functions

机译:高阶函数正向自动微分中的扰动混乱

获取原文
获取原文并翻译 | 示例

摘要

Automatic differentiation (AD) is a technique for augmenting computer programs to compute derivatives. The essence of AD in its forward accumulation mode is to attach perturbations to each number, and propagate these through the computation by overloading the arithmetic operators. When derivatives are nested, the distinct derivative calculations, and their associated perturbations, must be distinguished. This is typically accomplished by creating a unique tag for each derivative calculation and tagging the perturbations. We exhibit a subtle bug, present in fielded implementations which support derivatives of higher-order functions, in which perturbations are confused despite the tagging machinery, leading to incorrect results. The essence of the bug is as follows: a unique tag is needed for each derivative calculation, but in existing implementations unique tags are created when taking the derivative of a function at a point. When taking derivatives of higher-order functions, these need not correspond! We exhibit a simple example: a higher-order function f whose derivative at a point x, namely f'(x), is itself a function which calculates a derivative. This situation arises naturally when taking derivatives of curried functions. Two potential solutions are presented, and their deficiencies discussed. One uses eta expansion to delay the creation of fresh tags in order to put them into one-to-one correspondence with derivative calculations. The other wraps outputs of derivative operators with tag substitution machinery. Both solutions seem very difficult to implement without violating the desirable complexity guarantees of forward AD.
机译:自动微分(AD)是一种用于扩展计算机程序以计算导数的技术。 AD在其前向累积模式下的本质是将扰动附加到每个数字,并通过重载算术运算符将其通过计算传播。嵌套导数时,必须区分不同的导数计算及其相关的扰动。通常,这是通过为每个导数计算创建唯一的标记并标记扰动来实现的。我们展示了一个细微的错误,该错误存在于支持高阶函数派生的现场实现中,尽管使用了标记机制,但扰动仍被混淆,从而导致错误的结果。该错误的实质如下:每次导数计算都需要一个唯一的标记,但是在现有的实现中,在某个点取函数的导数时会创建唯一的标记。当采用高阶函数的导数时,这些不需要对应!我们展示一个简单的例子:一个高阶函数f,其在点x的导数即f'(x)本身就是一个计算导数的函数。当采用咖喱函数的导数时,这种情况自然会出现。介绍了两种可能的解决方案,并讨论了它们的不足。人们可以使用eta扩展来延迟新标签的创建,以便将它们与导数计算一一对应。另一个使用标签替换机制包装派生运算符的输出。在不违反前向AD所需的复杂性保证的情况下,两种解决方案似乎都很难实施。

著录项

  • 来源
    《Journal of Functional Programming》 |2019年第2019期|e12.1-e12.24|共24页
  • 作者单位

    Maynooth Univ Dept Comp Sci Maynooth Co Kildare Ireland|Maynooth Univ Hamilton Inst Maynooth Co Kildare Ireland|Facebook Menlo Pk CA 94025 USA;

    Maynooth Univ Dept Comp Sci Maynooth Co Kildare Ireland|Maynooth Univ Hamilton Inst Maynooth Co Kildare Ireland;

    Maynooth Univ Dept Comp Sci Maynooth Co Kildare Ireland|Maynooth Univ Hamilton Inst Maynooth Co Kildare Ireland|Google AI Mountain View CA USA;

    Purdue Univ Sch Elect & Comp Engn W Lafayette IN 47907 USA;

  • 收录信息 美国《科学引文索引》(SCI);
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号