提交 f914a40c authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Listing and figure

上级 a531dee6
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\usepackage{amsmath} \usepackage{amsmath}
\usepackage[utf8x]{inputenc} \usepackage[utf8x]{inputenc}
%\logo{\includegraphics[width=.8in]{UdeM_NoirBleu_logo_Marie_crop}} %\logo{\includegraphics[width=.8in]{UdeM_NoirBleu_logo_Marie_crop}}
\usepackage{listings}
\newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}} \newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}
...@@ -208,23 +209,34 @@ Montréal, Canada \newline ...@@ -208,23 +209,34 @@ Montréal, Canada \newline
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\begin{frame}{Simple example} % The following does not work with lstset, for some reason
%-------------- %\begin{frame}{Simple example}
% \begin{frame}[fragile]
%>>> import theano \frametitle{Simple example}
%>>> a = theano.tensor.vector("a") # declare symbolic variable
%>>> b = a + a ** 10 # build symbolic expression \lstset{language=Python,
%>>> f = theano.function([a], b) # compile function commentstyle=\itshape\color{blue}
%>>> print f([0, 1, 2]) # prints `array([0, 2, 1026])` }
% \begin{lstlisting}
% import theano
%====================================================== ===================================================== # declare symbolic variable
% Unoptimized graph Optimized graph a = theano.tensor.vector("a")
%====================================================== ===================================================== # build symbolic expression
%.. image:: ../hpcs2011_tutorial/pics/f_unoptimized.png .. image:: ../hpcs2011_tutorial/pics/f_optimized.png b = a + a ** 10
%====================================================== ===================================================== # compile function
% f = theano.function([a], b)
print f([0, 1, 2])
# prints `array([0, 2, 1026])`
\end{lstlisting}
\end{frame}
\begin{frame}{Simple example: graph optimization}
\center
\includegraphics[width=0.35\textwidth]{../hpcs2011_tutorial/pics/f_unoptimized.png}
\hspace{0.1\textwidth}
\includegraphics[width=0.35\textwidth]{../hpcs2011_tutorial/pics/f_optimized.png}
%Symbolic programming = *Paradigm shift*: people need to use it to understand it. %Symbolic programming = *Paradigm shift*: people need to use it to understand it.
\end{frame} \end{frame}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论