We present a simple functional programming language, called Dual PCF, that implements forward mode automatic differentiation using dual numbers. The main new feature of this language is the ability to evaluate - in a simple and direct way - the directional derivative of functionals. We provide a wide range of examples of Lipschitz functions and functionals that can be defined in Dual PCF. We use domain theory both to give a denotational semantics to the language and to prove the correctness of the new derivative operator using logical relations. To be able to differentiate functionals-including on function spaces equipped with their Scott topology that do not admit a norm-we develop a domain-theoretic directional derivative that is Scott continuous and extends Clarke's subgradient of real-valued locally Lipschitz maps on Banach spaces to real-valued continuous maps on topological vector spaces. Finally, we show that we can express arbitrary computable linear functionals in Dual PCF.
翻译:我们提出了一种名为Dual PCF的简单函数式编程语言,使用双重数实现了前向模式的自动微分。该语言的主要新功能是以简单直接的方式评估函数als的方向导数。我们提供了许多可以在Dual PCF中定义的Lipschitz函数和函数als的示例。我们使用域理论既给出了语言的指称语义,又通过逻辑关系证明了新的导数运算符的正确性。为了能够对包括不具有范数的函数空间在内的函数als进行微分,我们开发了一种域理论方向导数,它是Scott连续的,并将Clarke的次梯度从定义在Banach空间上的实值局部Lipschitz映射推广到定义在拓扑向量空间上的实值连续映射。最后,我们展示了我们可以在Dual PCF中表示任意可计算的线性函数als。