A tutorial on automatic differentiation with complex numbers

Nicholas Krämer
{"title":"A tutorial on automatic differentiation with complex numbers","authors":"Nicholas Krämer","doi":"arxiv-2409.06752","DOIUrl":null,"url":null,"abstract":"Automatic differentiation is everywhere, but there exists only minimal\ndocumentation of how it works in complex arithmetic beyond stating \"derivatives\nin $\\mathbb{C}^d$\" $\\cong$ \"derivatives in $\\mathbb{R}^{2d}$\" and, at best,\nshallow references to Wirtinger calculus. Unfortunately, the equivalence\n$\\mathbb{C}^d \\cong \\mathbb{R}^{2d}$ becomes insufficient as soon as we need to\nderive custom gradient rules, e.g., to avoid differentiating \"through\"\nexpensive linear algebra functions or differential equation simulators. To\ncombat such a lack of documentation, this article surveys forward- and\nreverse-mode automatic differentiation with complex numbers, covering topics\nsuch as Wirtinger derivatives, a modified chain rule, and different gradient\nconventions while explicitly avoiding holomorphicity and the Cauchy--Riemann\nequations (which would be far too restrictive). To be precise, we will derive,\nexplain, and implement a complex version of Jacobian-vector and vector-Jacobian\nproducts almost entirely with linear algebra without relying on complex\nanalysis or differential geometry. This tutorial is a call to action, for users\nand developers alike, to take complex values seriously when implementing custom\ngradient propagation rules -- the manuscript explains how.","PeriodicalId":501162,"journal":{"name":"arXiv - MATH - Numerical Analysis","volume":"171 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - MATH - Numerical Analysis","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.06752","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Automatic differentiation is everywhere, but there exists only minimal documentation of how it works in complex arithmetic beyond stating "derivatives in $\mathbb{C}^d$" $\cong$ "derivatives in $\mathbb{R}^{2d}$" and, at best, shallow references to Wirtinger calculus. Unfortunately, the equivalence $\mathbb{C}^d \cong \mathbb{R}^{2d}$ becomes insufficient as soon as we need to derive custom gradient rules, e.g., to avoid differentiating "through" expensive linear algebra functions or differential equation simulators. To combat such a lack of documentation, this article surveys forward- and reverse-mode automatic differentiation with complex numbers, covering topics such as Wirtinger derivatives, a modified chain rule, and different gradient conventions while explicitly avoiding holomorphicity and the Cauchy--Riemann equations (which would be far too restrictive). To be precise, we will derive, explain, and implement a complex version of Jacobian-vector and vector-Jacobian products almost entirely with linear algebra without relying on complex analysis or differential geometry. This tutorial is a call to action, for users and developers alike, to take complex values seriously when implementing custom gradient propagation rules -- the manuscript explains how.
复数自动微分教程
自动微分无处不在,但关于它如何在复杂算术中起作用,除了说明"$\mathbb{C}^d$中的导数"$\cong$"$\mathbb{R}^{2d}$中的导数 "以及充其量浅显地引用维廷格微积分之外,只有极少的文档。不幸的是,一旦我们需要导出自定义梯度规则,例如,为了避免 "通过 "昂贵的线性代数函数或微分方程模拟器进行微分,等价$mathbb{C}^d \cong \mathbb{R}^{2d}$就变得不够了。为了解决文献缺乏的问题,本文研究了复数的正向和反向自动微分,涵盖了 Wirtinger 导数、修正的链式规则和不同的梯度约定等主题,同时明确避免了全形性和 Cauchy--Rieman 问题(限制性太大)。准确地说,我们将推导、解释和实现复杂版本的雅各布向量和向量-雅各布积,几乎完全使用线性代数,而不依赖复杂分析或微分几何。本教程呼吁用户和开发人员在实施自定义梯度传播规则时,认真对待复杂值--手稿将解释如何实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信