Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/doc/diderot.tex
ViewVC logotype

Diff of /branches/vis12/doc/diderot.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/doc/diderot.tex revision 18, Fri Jan 15 02:36:12 2010 UTC branches/vis12/doc/diderot.tex revision 1685, Sun Jan 22 15:23:36 2012 UTC
# Line 29  Line 29 
29  \thispagestyle{empty}  \thispagestyle{empty}
30    
31  \section{Introduction}  \section{Introduction}
32  This document is a semi-formal design of Dedierot.  This document is a semi-formal design of Diderot.
33    
34  \section{Types}  \section{Types}
35  The syntax of Diderot types is given in \figref{fig:types}.  The syntax of Diderot types is given in \figref{fig:types}.
36  \begin{figure}[t]  \begin{figure}[t]
37    \begin{displaymath}    \begin{displaymath}
38      \begin{array}{rclr}      \begin{array}{rclr}
39        \rho  & ::= & $\ldots$ & \text{NNRD types} \\[1em]        \rho  & ::= & $\ldots$ & \text{NRRD scalar types} \\[1em]
40        \iota & ::= & \TYbool & \text{booleans} \\        \iota & ::= & \TYbool & \text{booleans} \\
41             & \mid & \TYint & \text{integers} \\[1em]             & \mid & \TYint & \text{integers} \\[1em]
42        \theta & ::= & \TYtensor{o}{d} & \text{tensors of order $o$ and dimension $d$} \\[1em]        % \mu for memory, where images of rawtensors will live (or on disk)
43          \mu & ::= & \TYrawten{\Seq{d}}{\rho} & \begin{minipage}[l]{3in}\begin{flushright}
44              tensors of order $|\Seq{d}|$ and dimensions $\Seq{d}$,\\with coefficients of type $\rho$
45              \end{flushright}\end{minipage}\\[1em]
46          \theta & ::= & \TYtensor{\Seq{d}} & \begin{minipage}[l]{3in}\begin{flushright}
47              tensors of order $|\Seq{d}|$ and dimensions $\Seq{d}$,\\with real coefficients
48              \end{flushright}\end{minipage}\\[1em]
49        \tau & ::= & \iota \\        \tau & ::= & \iota \\
50             & \mid & \theta \\             & \mid & \theta \\
51             & \mid & \TYmatrix{n}{m} & \text{$n\times{}m$ matrix} \\             & \mid & \TYmatrix{n}{m} & \text{$n\times{}m$ matrix} \\
52             & \mid & \TYimage{d}{\rho} & \text{image of dimension $d$ and $\rho$ elements}\\             & \mid & \TYimage{d}{\mu} & \text{$d$-dimension image of $\mu$ values}\\
53             & \mid & \TYkern{k} & \text{convolution kernel with $k$ derivatives} \\             & \mid & \TYkern{k} & \text{convolution kernel with $k$ derivatives} \\
54             & \mid & \TYfield{k}{d}{\theta} & \text{$d$-dimension field of $\theta$ values and $k$ derivatives} \\             & \mid & \TYfield{k}{d}{\theta} & \text{$d$-dimension field of $\theta$ values with $k$ derivatives} \\
55      \end{array}%      \end{array}%
56    \end{displaymath}%    \end{displaymath}%
57    where $o\in\Nat$ is the tensor order, $d,n,m\in\SET{2,3}$ are dimensions,    where $o\in\Nat$ is the tensor order, $d,n,m\in\SET{2,3}$ are dimensions,
# Line 55  Line 61 
61  \end{figure}%  \end{figure}%
62  We use some type abbreviations for common cases:  We use some type abbreviations for common cases:
63  \begin{eqnarray*}  \begin{eqnarray*}
64    \TYreal & = & \TYtensor{0}{d} \quad\text{for any $d$} \\    \TYreal & = & \TYtensor{\epsilon} \quad\text{for any $d$} \\
65    \TYvec{d} & = & \TYtensor{1}{d}    \TYvec{d} & = & \TYtensor{d}
66  \end{eqnarray*}%  \end{eqnarray*}%
67    
68  \section{Operations}  \section{Operations}
69    
70  \subsection{Scalar operations}  \subsection{Scalar operations}
71  \noindent{}Arithmetic:  \noindent{}\point Arithmetic:
72  \begin{displaymath}  \begin{displaymath}
73    \begin{array}{cl}    \begin{array}{cl}
74      \BinopTy{{\odot}}{\tau}{\tau}{\tau}      \BinopTy{{\odot}}{\tau}{\tau}{\tau}
75      & \text{for $\odot\in\SET{{+},{-},{*},{/}}$ and $\tau\in\SET{\TYint,\TYreal}$} \\      & \text{for $\odot\in\SET{\OP{+},\OP{-},\OP{*},\OP{/}}$ and $\tau\in\SET{\TYint,\TYreal}$} \\
76      \UnopTy{{-}}{\tau}{\tau}      \UnopTy{\OP{-}}{\tau}{\tau}
77      & \text{for $\tau\in\SET{\TYint,\TYreal}$}      & \text{for $\tau\in\SET{\TYint,\TYreal}$}
78    \end{array}%    \end{array}%
79  \end{displaymath}%  \end{displaymath}%
80    
81  \noindent{}Comparisons:  \noindent{}\point Comparisons:
82  \begin{displaymath}  \begin{displaymath}
83    \BinopTy{{\odot}}{\tau}{\tau}{\TYbool}    \BinopTy{{\odot}}{\tau}{\tau}{\TYbool}
84    \qquad\text{for $\odot\in\SET{{<},{\leq},{=},{\neq}{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$}    \qquad\text{for $\odot\in\SET{\OP{<},{\leq},\OP{=},{\neq}\OP{>},{\geq}}$ and $\tau\in\SET{\TYint,\TYreal}$}
85  \end{displaymath}%  \end{displaymath}%
86    
87    
# Line 83  Line 89 
89    
90  \subsection{Tensor operations}  \subsection{Tensor operations}
91    
92  \noindent{}Scalar multiplication:  \noindent{}\point Addition:
93    \begin{displaymath}
94      \BinopTy{{\odot}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}
95      \qquad\text{for $\odot\in\SET{\OP{+},\OP{-}}$}
96    \end{displaymath}%
97    
98    \noindent{}\point Negation:
99    \begin{displaymath}
100      \UnopTy{\OP{-}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}
101    \end{displaymath}%
102    
103    \noindent{}\point Scalar division:
104    \begin{displaymath}
105      \BinopTy{\OP{/}}{\TYtensor{\Seq{d}}}{\TYreal}{\TYtensor{\Seq{d}}}
106    \end{displaymath}%
107    
108    \noindent{}\point Scalar multiplication (scalar times order-N):
109    \begin{displaymath}
110      \begin{array}{c}
111        \BinopTy{\OP{*}}{\TYreal}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}} \\
112        \BinopTy{\OP{*}}{\TYtensor{\Seq{d}}}{\TYreal}{\TYtensor{\Seq{d}}}
113      \end{array}%
114    \end{displaymath}%
115    
116    \noindent{}\point Tensor scalar multiplication (contraction of two order-N
117    tensors down to a scalar, \eg{} dot product of vectors, double dot
118    product of 2nd-order tensors)
119    \begin{displaymath}
120      \begin{array}{c}
121        \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}{\TYreal}
122      \end{array}%
123    \end{displaymath}%
124    Defined by $c = A_{\vec{i}}B_{\vec{i}}$
125    ~(\eg{} $\mathbf{a}\cdot\mathbf{b} = a_ib_i$  or $\mathbf{A:B} = A_{ij}B_{ij}$)
126    NOTE: In this and subsequent index notation expressions, a vector over the index variable
127    (\eg{} $\vec{i}$) means that the variable is in fact standing for a sequence of
128    contiguous index variables \\
129    Possible direct notation syntax: ~~ {\tt .} (period) ~~ {\tt :} (colon) ~~ {\tt dot} ~~ {\tt o}
130    
131    \noindent{}\point Tensor product (aka outer product; order output is sum of orders)
132  \begin{displaymath}  \begin{displaymath}
133    \begin{array}{c}    \begin{array}{c}
134      \BinopTy{{*}}{\TYreal}{\TYtensor{o}{d}}{\TYtensor{o}{d}} \\      \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d'}}}{\TYtensor{\Seq{d}\Seq{d'}}}
     \BinopTy{{*}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}}  
135    \end{array}%    \end{array}%
136  \end{displaymath}%  \end{displaymath}%
137    Defined by $C_{\vec{i}\vec{j}} = A_{\vec{i}}B_{\vec{j}}$ \\
138    Possible direct notation syntax: ~~ {\tt x} ~~ {\tt (x)} ~~ {\tt out}
139    
140  \noindent{}Scalar division:  \noindent{}\point Matrix Multiply
141  \begin{displaymath}  \begin{displaymath}
142    \BinopTy{{/}}{\TYtensor{o}{d}}{\TYreal}{\TYtensor{o}{d}}    \begin{array}{c}
143        \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{d_1 d_2}}{\TYtensor{\Seq{d}}} \\
144        \BinopTy{{?}}{\TYtensor{d_1 d_2}}{\TYtensor{\Seq{d}}}{\TYtensor{\Seq{d}}}
145      \end{array}%
146  \end{displaymath}%  \end{displaymath}%
147    Defined by $C_{i\vec{k}} = A_{ij}B_{j\vec{k}}$ and $C_{\vec{i}k} = B_{\vec{i}j}A_{jk}$
148    ~(\eg{} $u_i = M_{ij}v_j$ or $T_{ijl} = S_{ijk}M_{kl}$) \\
149    Possible direct notation syntax: ~~ ?
150    
151  \noindent{}Addition:  \noindent{}\point Contracting out last or first index of tensor (order $o \geq 1$)
152    with vector
153  \begin{displaymath}  \begin{displaymath}
154    \BinopTy{{\odot}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}{\TYtensor{o}{d}}    \begin{array}{c}
155    \qquad\text{for $\odot\in\SET{{+},{-}}$}      \BinopTy{{?}}{\TYtensor{d'\Seq{d}}}{\TYvec{d}}{\TYtensor{\Seq{d}}} \\
156        \BinopTy{{?}}{\TYvec{d}}{\TYtensor{d'\Seq{d}}}{\TYtensor{\Seq{d}}}
157      \end{array}%
158  \end{displaymath}%  \end{displaymath}%
159    Defined by $C_{\vec{i}} = A_{\vec{i}j}v_j$ and $C_{\vec{j}} = v_iA_{j\vec{j}}$ \\
160    Possible direct notation syntax: ~~ ?
161    
162  \noindent{}Negation:  \noindent{}\point Arbitrary ``tensor comprehension''. The product can also be
163    expressed in general index notation, and which may increase, preserve, or
164    decrease the tensor order.
165  \begin{displaymath}  \begin{displaymath}
166    \UnopTy{-}{\TYtensor{o}{d}}{\TYtensor{o}{d}}    \begin{array}{c}
167        \BinopTy{{?}}{\TYtensor{\Seq{d}}}{\TYtensor{p}{d}}{\TYtensor{q}{d}}
168      \end{array}%
169  \end{displaymath}%  \end{displaymath}%
170    Defined by the conventions of Einstein summation notation. \\
171    Possible syntax: {\tt <A.i.j.k,B.j.k.l>} ~~ {\tt <A\_i\_j\_k,B\_j\_k\_l>}
172    
173  \subsection{Field operations}  \subsection{Field operations}
174    
175  \noindent{}Creation from an image:  \noindent{}\point Creation from an image:
176  \begin{displaymath}  \begin{displaymath}
177    \BinopTy{\OPsample}{\TYkern{k}}{\TYimage{d}{\rho}}{\TYfield{k}{d}{\theta}}    \BinopTy{\OPconvolve}{\TYkern{k}}{\TYimage{d'}{\TYrawten{\Seq{d}}{\rho}}}{\TYfield{k}{d'}{\TYtensor{\Seq{d}}}}
   \qquad\text{where $\theta$ is the real conversion of $\rho$.}  
178  \end{displaymath}%  \end{displaymath}%
179    
180  \noindent{}Scalar multiplication:  \noindent{}\point Scalar multiplication:
181  \begin{displaymath}  \begin{displaymath}
182    \begin{array}{c}    \begin{array}{c}
183      \BinopTy{{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\      \BinopTy{\OP{*}}{\TYreal}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\
184      \BinopTy{{*}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}}      \BinopTy{\OP{*}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}}
185    \end{array}%    \end{array}%
186  \end{displaymath}%  \end{displaymath}%
187    
188  \noindent{}Scalar division:  \noindent{}\point Scalar division:
189  \begin{displaymath}  \begin{displaymath}
190    \BinopTy{{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}}    \BinopTy{\OP{/}}{\TYfield{k}{d}{\theta}}{\TYreal}{\TYfield{k}{d}{\theta}}
191  \end{displaymath}%  \end{displaymath}%
192    
193  \noindent{}Addition:  \noindent{}\point Negation:
194  \begin{displaymath}  \begin{displaymath}
195    \BinopTy{{\odot}}{\TYfield{k_1}{d}{\theta}}{\TYfield{k_2}{d}{\theta}}{\TYfield{\min(k_1,k_2)}{d}{\theta}}    \UnopTy{\OP{-}}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}}
   \qquad\text{for $\odot\in\SET{{+},{-}}$}  
196  \end{displaymath}%  \end{displaymath}%
197    
198  \noindent{}Differentiation:  \noindent{}\point Addition:
199  \begin{displaymath}  \begin{displaymath}
200    \UnopTy{\OPdiff}{\TYfield{k}{d}{\TYtensor{o}{d}}}{\TYfield{k-1}{d}{\TYtensor{o+1}{d}}}    \begin{array}{c}
201    \qquad\text{for $k > 0$}    \BinopTy{{\odot}}{\TYfield{k}{d}{\theta}}{\theta}{\TYfield{k}{d}{\theta}} \\
202      \BinopTy{{\odot}}{\theta}{\TYfield{k}{d}{\theta}}{\TYfield{k}{d}{\theta}} \\
203      \BinopTy{{\odot}}{\TYfield{k_1}{d}{\theta}}{\TYfield{k_2}{d}{\theta}}{\TYfield{\min(k_1,k_2)}{d}{\theta}}
204      \end{array}%
205      \qquad\text{for $\odot\in\SET{\OP{+},\OP{-}}$}
206  \end{displaymath}%  \end{displaymath}%
207    
208  \noindent{}Probing:  \noindent{}\point Differentiation:
209  \begin{displaymath}  \begin{displaymath}
210    \BinopTy{@}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta}    \UnopTy{\OPdiff}{\TYfield{k}{d'}{\TYtensor{\Seq{d}}}}{\TYfield{k-1}{d'}{\TYtensor{d'\Seq{d}}}}
211      \qquad\text{for $k > 0$}
212  \end{displaymath}%  \end{displaymath}%
213    
214  \noindent{}Tensor arithmetic:  \noindent{}\point Probing:
215  \begin{displaymath}  \begin{displaymath}
216    \begin{array}{c}    \BinopTy{\OP{@}}{\TYfield{k}{d}{\theta}}{\TYvec{d}}{\theta}
     \BinopTy{{\odot}}{\TYfield{k}{d}{\tau}}{\tau}{\TYfield{k}{d}{\tau}} \\  
     \BinopTy{{\odot}}{\tau}{\TYfield{k}{d}{\tau}}{\TYfield{k}{d}{\tau}}  
   \end{array}  \qquad\text{for $\odot\in\SET{{+},{-}}$}  
217  \end{displaymath}%  \end{displaymath}%
218    
219  \end{document}  \end{document}

Legend:
Removed from v.18  
changed lines
  Added in v.1685

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0