On Correctness of Automatic Differentiation for Non-Differentiable Functions

06/12/2020
by   Wonyeol Lee, et al.
0

Differentiation lies at the core of many machine-learning algorithms, and is well-supported by popular autodiff systems, such as TensorFlow and PyTorch. Originally, these systems have been developed to compute derivatives of differentiable functions, but in practice, they are commonly applied to functions with non-differentiabilities. For instance, neural networks using ReLU define non-differentiable functions in general, but the gradients of losses involving those functions are computed using autodiff systems in practice. This status quo raises a natural question: are autodiff systems correct in any formal sense when they are applied to such non-differentiable functions? In this paper, we provide a positive answer to this question. Using counterexamples, we first point out flaws in often-used informal arguments, such as: non-differentiabilities arising in deep learning do not cause any issues because they form a measure-zero set. We then investigate a class of functions, called PAP functions, that includes nearly all (possibly non-differentiable) functions in deep learning nowadays. For these PAP functions, we propose a new type of derivatives, called intensional derivatives, and prove that these derivatives always exist and coincide with standard derivatives for almost all inputs. We also show that these intensional derivatives are what most autodiff systems compute or try to compute essentially. In this way, we formally establish the correctness of autodiff systems applied to non-differentiable functions.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/31/2023

On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters

Recent work has shown that automatic differentiation over the reals is a...
research
11/30/2021

Towards Denotational Semantics of AD for Higher-Order, Recursive, Probabilistic Languages

Automatic differentiation (AD) aims to compute derivatives of user-defin...
research
07/15/2020

λ_S: Computable semantics for differentiable programming with higher-order functions and datatypes

Deep learning is moving towards increasingly sophisticated optimization ...
research
05/01/2023

Differentiable Neural Networks with RePU Activation: with Applications to Score Estimation and Isotonic Regression

We study the properties of differentiable neural networks activated by r...
research
11/26/2019

Recursive multivariate derivatives of e^f(x_1,..., x_n) of arbitrary order

High-order derivatives of nested functions of a single variable can be c...
research
10/19/2020

Quaternionic Step Derivative: Automatic Differentiation of Holomorphic Functions using Complex Quaternions

Complex Step Derivative (CSD) allows easy and accurate differentiation u...
research
05/24/2019

Landau: language for dynamical systems with automatic differentiation

Most numerical solvers used to determine free variables of dynamical sys...

Please sign up or login with your details

Forgot password? Click here to reset