<s>
In	O
mathematics	O
and	O
computer	B-Algorithm
algebra	I-Algorithm
,	O
automatic	B-Algorithm
differentiation	I-Algorithm
(	O
auto-differentiation	B-Algorithm
,	O
autodiff	O
,	O
or	O
AD	O
)	O
,	O
also	O
called	O
algorithmic	B-Algorithm
differentiation	I-Algorithm
,	O
computational	B-Algorithm
differentiation	I-Algorithm
,	O
is	O
a	O
set	O
of	O
techniques	O
to	O
evaluate	O
the	O
partial	O
derivative	O
of	O
a	O
function	O
specified	O
by	O
a	O
computer	O
program	O
.	O
</s>
<s>
Automatic	B-Algorithm
differentiation	I-Algorithm
exploits	O
the	O
fact	O
that	O
every	O
computer	O
program	O
,	O
no	O
matter	O
how	O
complicated	O
,	O
executes	O
a	O
sequence	O
of	O
elementary	O
arithmetic	O
operations	O
(	O
addition	O
,	O
subtraction	O
,	O
multiplication	O
,	O
division	O
,	O
etc	O
.	O
)	O
</s>
<s>
Automatic	B-Algorithm
differentiation	I-Algorithm
is	O
distinct	O
from	O
symbolic	B-Algorithm
differentiation	I-Algorithm
and	O
numerical	B-Algorithm
differentiation	I-Algorithm
.	O
</s>
<s>
Symbolic	B-Algorithm
differentiation	I-Algorithm
faces	O
the	O
difficulty	O
of	O
converting	O
a	O
computer	O
program	O
into	O
a	O
single	O
mathematical	O
expression	O
and	O
can	O
lead	O
to	O
inefficient	O
code	O
.	O
</s>
<s>
Numerical	B-Algorithm
differentiation	I-Algorithm
(	O
the	O
method	O
of	O
finite	O
differences	O
)	O
can	O
introduce	O
round-off	B-Algorithm
errors	I-Algorithm
in	O
the	O
discretization	B-Algorithm
process	O
and	O
cancellation	O
.	O
</s>
<s>
Finally	O
,	O
both	O
of	O
these	O
classical	O
methods	O
are	O
slow	O
at	O
computing	O
partial	O
derivatives	O
of	O
a	O
function	O
with	O
respect	O
to	O
many	O
inputs	O
,	O
as	O
is	O
needed	O
for	O
gradient-based	B-Algorithm
optimization	I-Algorithm
algorithms	O
.	O
</s>
<s>
Automatic	B-Algorithm
differentiation	I-Algorithm
solves	O
all	O
of	O
these	O
problems	O
.	O
</s>
<s>
Fundamental	O
to	O
automatic	B-Algorithm
differentiation	I-Algorithm
is	O
the	O
decomposition	O
of	O
differentials	O
provided	O
by	O
the	O
chain	O
rule	O
of	O
partial	O
derivatives	O
of	O
composite	B-Application
functions	I-Application
.	O
</s>
<s>
Usually	O
,	O
two	O
distinct	O
modes	O
of	O
automatic	B-Algorithm
differentiation	I-Algorithm
are	O
presented	O
.	O
</s>
<s>
Backpropagation	B-Algorithm
of	O
errors	O
in	O
multilayer	O
perceptrons	O
,	O
a	O
technique	O
used	O
in	O
machine	O
learning	O
,	O
is	O
a	O
special	O
case	O
of	O
reverse	O
accumulation	O
.	O
</s>
<s>
To	O
compute	O
the	O
gradient	B-Algorithm
of	O
this	O
example	O
function	O
,	O
which	O
requires	O
not	O
only	O
but	O
also	O
,	O
an	O
additional	O
sweep	O
is	O
performed	O
over	O
the	O
computational	O
graph	O
using	O
the	O
seed	O
values	O
.	O
</s>
<s>
The	O
example	O
function	O
is	O
scalar-valued	O
,	O
and	O
thus	O
there	O
is	O
only	O
one	O
seed	O
for	O
the	O
derivative	O
computation	O
,	O
and	O
only	O
one	O
sweep	O
of	O
the	O
computational	O
graph	O
is	O
needed	O
to	O
calculate	O
the	O
(	O
two-component	O
)	O
gradient	B-Algorithm
.	O
</s>
<s>
The	O
data	O
flow	O
graph	O
of	O
a	O
computation	O
can	O
be	O
manipulated	O
to	O
calculate	O
the	O
gradient	B-Algorithm
of	O
its	O
original	O
calculation	O
.	O
</s>
<s>
Implementation	O
in	O
Python	B-Language
without	O
tapes	O
.	O
</s>
<s>
Forward	O
mode	O
automatic	B-Algorithm
differentiation	I-Algorithm
is	O
accomplished	O
by	O
augmenting	O
the	O
algebra	O
of	O
real	O
numbers	O
and	O
obtaining	O
a	O
new	O
arithmetic	O
.	O
</s>
<s>
Extending	O
the	O
above	O
results	O
on	O
polynomials	O
to	O
analytic	B-Language
functions	I-Language
gives	O
a	O
list	O
of	O
the	O
basic	O
arithmetic	O
and	O
some	O
standard	O
functions	O
for	O
the	O
new	O
arithmetic	O
:	O
</s>
<s>
This	O
nonstandard	O
interpretation	O
is	O
generally	O
implemented	O
using	O
one	O
of	O
two	O
strategies	O
:	O
source	B-Application
code	I-Application
transformation	I-Application
or	O
operator	O
overloading	O
.	O
</s>
<s>
Source	B-Application
code	I-Application
transformation	I-Application
can	O
be	O
implemented	O
for	O
all	O
programming	O
languages	O
,	O
and	O
it	O
is	O
also	O
easier	O
for	O
the	O
compiler	O
to	O
do	O
compile	O
time	O
optimizations	O
.	O
</s>
<s>
Examples	O
of	O
operator-overloading	O
implementations	O
of	O
automatic	B-Algorithm
differentiation	I-Algorithm
in	O
C++	O
are	O
the	O
Adept	B-Language
,	O
the	O
NAG	O
's	O
dco	O
library	O
,	O
and	O
the	O
Stan	B-Application
libraries	O
.	O
</s>
