File: talk.tex

package info (click to toggle)
cppad 2025.00.00.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,552 kB
  • sloc: cpp: 112,594; sh: 5,972; ansic: 179; python: 71; sed: 12; makefile: 10
file content (222 lines) | stat: -rw-r--r-- 5,132 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
% SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
% SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
% SPDX-FileContributor: 2003-22 Bradley M. Bell
% ----------------------------------------------------------------------------
\documentclass{beamer}

% needed for fonts; see %https://tex.stackexchange.com/questions/58087/
% how-to-remove-the-warnings-font-shape-ot1-cmss-m-n-in-size-4-not-available
\usepackage{lmodern}% http://ctan.org/pkg/lm

% macros
\newcommand{\B}[1]{{\bf #1}}


\title[CppAD]{CppAD's Abs-normal Representation}
\institute{
   \begin{tabular}{c}
      {\Large Bradley M. Bell} \\
      \\
      Applied Physics Laboratory and \\
      Institute for Health Metrics and Evaluation, \\
      University of Washington, \\
      \texttt{bradbell@uw.edu} \\
   \end{tabular}
}

\begin{document}

\begin{frame}
   \titlepage
\end{frame}



% ----------------------------------------------------------------------------
\begin{frame}{Non-Smooth Functions}

\begin{block}{$f(x)$}
$ f : \B{R}^n \rightarrow \B{R}^m $ where the only non-smooth
nodes in its computational graph are $| \cdot |$.
\end{block}
\pause

\begin{block}{$a(x)$}
Let $s$ be number of $| \cdot |$ in $f$.
We define
$a : \B{R}^n \rightarrow \B{R}^s$ where
$a_i (x)$ is the result for the $i$-th absolute value.
\end{block}

\end{frame}
% ----------------------------------------------------------------------------
\begin{frame}{Smooth Functions}

\begin{block}{$z(x,u)$}
There is a smooth
$z : \B{R}^{n + s} \rightarrow \B{R}^s$ where
$z_i (x, u)$ is argument to $i$-th absolute value
when $u_j = a_j (x)$ for $j < i$.
\end{block}
\pause

\begin{block}{$y(x,u)$}
There is a smooth
$y : \B{R}^{n + s} \rightarrow \B{R}^m$ where
$y(x , u) = f(x)$ when $u = a (x)$ for all $i$.
\end{block}
\pause

\begin{block}{$g(x,u)$}
The function
$g : \B{R}^{n + s} \rightarrow \B{R}^{m + s}$ is defined by
\[
g(x, u) = \left[ \begin{array}{c} y(x, u) \\ z(x, y) \end{array} \right]
\]
\end{block}

\end{frame}
% ----------------------------------------------------------------------------
\begin{frame}{Approximating $a(x)$}

\[
z[ \hat{x} ]( x , u )
=
z ( \hat{x}, a( \hat{x} ) )
   + \partial_x z ( \hat{x}, a( \hat{x} ) ) ( x - \hat{x} )
   + \partial_u z ( \hat{x}, a( \hat{x} ) ) ( u - a( \hat{x} ) )
\]
\pause

Note that $z_0 ( x , u )$ does not depend on $u$:
\[
a_0 [ \hat{x} ]( x )
=
\left|
   z_0 ( \hat{x}, a( \hat{x} ) )
   + \partial_x z_0 ( \hat{x}, a( \hat{x} ) ) ( x - \hat{x} )
\right|
\]
\pause

\begin{eqnarray*}
a_i [ \hat{x} ]( x )
& = &
\left | \vphantom{ \sum_{j < i} } z_i ( \hat{x}, a( \hat{x} ) )
   + \partial_x z_i ( \hat{x}, a( \hat{x} ) ) ( x - \hat{x} )
\right.
\\
& + &
\left. \sum_{j < i} \partial_{u(j)} z_i ( \hat{x}, a( \hat{x} ) )
         ( a_j [ \hat{x} ] ( x )  - a_j ( \hat{x} ) )
\right|
\end{eqnarray*}
\pause

\[
a(x) = a[ \hat{x} ]( x ) + o( x - \hat{x} )
\phantom{\rule{1in}{1pt}}
\]


\end{frame}
% ----------------------------------------------------------------------------
\begin{frame}{Representation}

\begin{block}{ \texttt{f.abs\_normal\_fun(g, a)} }
Given the \texttt{ADFun<Base>} object \texttt{f} for $f(x)$,
this creates the two \texttt{ADFun<Base>} objects \texttt{g}, \texttt{a}
for $g(x, u)$ and $a(x)$ respectively.
\end{block}
\pause

\begin{block}{Advantages}
Any AD operation can be computed for the smooth function \texttt{g}; e.g.,
any order forward and reverse mode, sparsity patterns, and sparse derivatives.
\end{block}

\end{frame}
% ----------------------------------------------------------------------------
\begin{frame}{Approximating $f(x)$}

\[
y[ \hat{x} ]( x , u )
=
y ( \hat{x}, a( \hat{x} ) )
   + \partial_x y ( \hat{x}, a( \hat{x} ) ) ( x - \hat{x} )
   + \partial_u y ( \hat{x}, a( \hat{x} ) ) ( u - a( \hat{x} ) )
\]
\pause


\[
f(x) = y[ \hat{x} ] ( x , a[ \hat{x} ] (x) ) + o ( x - \hat{x} )
\phantom{\rule{1.3in}{1pt}}
\]

\begin{block}{ \texttt{abs\_eval(n, m, s, g\_hat , g\_jac , delta\_x)} }
Evaluates $y[ \hat{x} ] ( x , a[ \hat{x} ] (x) )$
\end{block}
\pause

\begin{itemize}

\item
\texttt{g\_hat} is $g[ \hat{x} , a( \hat{x} ) ]$
\pause

\item
\texttt{g\_jac} is $g^{(1)} [ \hat{x} , a( \hat{x} ) ]$
\pause

\item
\texttt{delta\_x} is $x - \hat{x}$

\end{itemize}


\end{frame}
% ----------------------------------------------------------------------------

\begin{frame}{ \texttt{abs\_min\_linear} }

\begin{block}{Problem}
minimize $\tilde{f} ( x ) = y[ \hat{x} ] ( x , a( \hat{x} ) )$ w.r.t
$x$ subject to $-b \leq x \leq b$ using the assumption
that $\tilde{f} (x)$ is convex.
\end{block}
\pause


\begin{block}{Algorithm}
\begin{enumerate}

\item
Start at with point  $x = \hat{x}$ and $C$ an empty set of
cutting planes.
\pause

\item
\label{NextIterationItem}
Add affine apprimation for $\tilde{f} ( x )$ at $x$ to $C$.
\pause


\item
Minimize w.r.t $x$ the maximum of the affine functions in $C$
subject to $-b \leq x \leq b$ (this is an LP).
\pause


\item
If change in $x$ for this this iteration is small, return $x$ as solution.
Otherwise, goto step \ref{NextIterationItem}.

\end{enumerate}
\end{block}


\end{frame}


\end{document}