提交 d41af74f authored 作者: Frederic Bastien's avatar Frederic Bastien

Updated the slide exercises after the tutorial.

上级 af5457e1
...@@ -171,10 +171,10 @@ HPCS 2011, Montr\'eal ...@@ -171,10 +171,10 @@ HPCS 2011, Montr\'eal
\item Real example \item Real example
% More info on T.grad % More info on T.grad
% Where are the optimization in the example? % Where are the optimization in the example?
% Exercises 2 % Exercises 2: logreg\_example.py
\item Theano Flags \item Theano Flags
\item GPU \item GPU
% Exercises 3 % Exercises 3: logreg\_example.py on the gpu
\item Symbolic Variables \item Symbolic Variables
\item Differentiation Details \item Differentiation Details
\item Benchmarks % MLP, Convolucion, Elemwise \item Benchmarks % MLP, Convolucion, Elemwise
...@@ -193,10 +193,11 @@ HPCS 2011, Montr\'eal ...@@ -193,10 +193,11 @@ HPCS 2011, Montr\'eal
\item Compilation Pipeline \item Compilation Pipeline
\item Inplace Optimization \item Inplace Optimization
\item Profiling \item Profiling
%exercises 4 %exercises 4: ProfileMode on logreg\_example, CPU vs GPU
\item Drawing/Printing Theano Graph \item Drawing/Printing Theano Graph
\item Debugging \item Debugging
\item Scan (For-Loop generalization) \item Scan (For-Loop generalization)
%exercises 5: about scan
\item Known Limitations \item Known Limitations
\end{itemize} %& \includegraphics[width=1.in]{pics/theano_logo.png} \end{itemize} %& \includegraphics[width=1.in]{pics/theano_logo.png}
\begin{tabular}{lcr} \begin{tabular}{lcr}
...@@ -213,7 +214,7 @@ HPCS 2011, Montr\'eal ...@@ -213,7 +214,7 @@ HPCS 2011, Montr\'eal
\begin{itemize} \begin{itemize}
\item Introduction \item Introduction
\item Example \item Example
% PyCUDA Exercices % Exercices 6: pycuda_simple.py
\end{itemize} \end{itemize}
\item CUDA Overview \item CUDA Overview
\item Extending Theano \item Extending Theano
...@@ -221,8 +222,9 @@ HPCS 2011, Montr\'eal ...@@ -221,8 +222,9 @@ HPCS 2011, Montr\'eal
\item Theano Graph \item Theano Graph
\item Op Contract \item Op Contract
\item Op Example \item Op Example
% Exercises 7: double.py
\item Theano + PyCUDA \item Theano + PyCUDA
% Theano+PyCUDA Exercises % Exercises 8: pycuda_double_op.py
\end{itemize} \end{itemize}
\item GpuNdArray \item GpuNdArray
\item Conclusion \item Conclusion
...@@ -657,7 +659,7 @@ Theano can be configured with flags. They can be defined in two ways ...@@ -657,7 +659,7 @@ Theano can be configured with flags. They can be defined in two ways
python logreg_example.py python logreg_example.py
\end{Verbatim} \end{Verbatim}
\vfill \vfill
Modify and execute the example to run on CPU with floatX=float32 Modify and execute the example in the file logreg\_example.py to run on CPU with floatX=float32
* You will need to use: theano.config.floatX and ndarray.astype("str") * You will need to use: theano.config.floatX and ndarray.astype("str")
\end{frame} \end{frame}
...@@ -715,7 +717,6 @@ Computers in the class ...@@ -715,7 +717,6 @@ Computers in the class
\begin{itemize} \begin{itemize}
\item Modify and execute the code to run with floatX=float32 on GPU \item Modify and execute the code to run with floatX=float32 on GPU
\item Run the code on the GPU
\item Time with: \texttt{time python file.py} \item Time with: \texttt{time python file.py}
\end{itemize} \end{itemize}
\end{frame} \end{frame}
...@@ -1167,7 +1168,8 @@ print calculate_polynomial(test_coeff, 3) ...@@ -1167,7 +1168,8 @@ print calculate_polynomial(test_coeff, 3)
\frame{ \frame{
\frametitle{Exercises 5} \frametitle{Exercises 5}
\begin{itemize} \begin{itemize}
\item Scan: modify the polynomial example to have the reduction done by scan \item Run the example in the file scan\_pow.py and scan\_poly.py
\item Modify and execute the polynomial example to have the reduction done by scan
\end{itemize} \end{itemize}
} }
...@@ -1335,9 +1337,9 @@ multiply_them( ...@@ -1335,9 +1337,9 @@ multiply_them(
} }
\begin{frame} \begin{frame}
\frametitle{PyCUDA Exercises} \frametitle{Exercises 6}
\begin{itemize} \begin{itemize}
\item Run the example in the file pycuda_simple.py \item Run the example in the file pycuda\_simple.py
\item Modify and execute it to work for a matrix of 20 $\times$ 10 \item Modify and execute it to work for a matrix of 20 $\times$ 10
\end{itemize} \end{itemize}
\end{frame} \end{frame}
...@@ -1429,6 +1431,18 @@ print out ...@@ -1429,6 +1431,18 @@ print out
\end{Verbatim} \end{Verbatim}
\end{frame} \end{frame}
\begin{frame}
\frametitle{Exercises 7}
\begin{itemize}
\item Run the code in the file double\_op.py.
\item Modify and execute to compute: $x * y$
\item Modify and execute the example to return 2 outputs: $x + y$ and $x - y$
\begin{itemize}
\item Our current elemwise fusion generate computation with only 1 outputs
\end{itemize}
\end{itemize}
\end{frame}
\subsection{Theano+PyCUDA} \subsection{Theano+PyCUDA}
\begin{frame}[fragile] \begin{frame}[fragile]
\frametitle{Theano+PyCUDA Op Example} \frametitle{Theano+PyCUDA Op Example}
...@@ -1501,8 +1515,9 @@ print numpy.asarray(f(xv)) ...@@ -1501,8 +1515,9 @@ print numpy.asarray(f(xv))
\end{frame} \end{frame}
\begin{frame} \begin{frame}
\frametitle{Theano + PyCUDA Exercises} \frametitle{Exercises 8}
\begin{itemize} \begin{itemize}
\item Run the example in the file pycuda\_double\_op.py
\item Modify and execute the example to multiple two matrix: $x * y$ \item Modify and execute the example to multiple two matrix: $x * y$
\item Modify and execute the example to return 2 outputs: $x + y$ and $x - y$ \item Modify and execute the example to return 2 outputs: $x + y$ and $x - y$
\begin{itemize} \begin{itemize}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论