提交 fa1d9c4a authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2100 from nouiz/omlw

Open Machine Learning Workshop 2014 presentation
......@@ -10,7 +10,6 @@
*.log
*.nav
*.out
*.pdf
*.snm
*.toc
*.vrb
......
......@@ -21,6 +21,8 @@ Montreal).
News
====
* Open Machine Learning Workshop 2014 `presentation <omlw2014/omlw_presentation.pdf>`_.
* Colin Raffel `tutorial on Theano <http://nbviewer.ipython.org/github/craffel/theano-tutorial/blob/master/Theano%20Tutorial.ipynb>`_.
* Ian Goodfellow did a `12h class with exercises on Theano <https://github.com/goodfeli/theano_exercises>`_.
......
all: presentation.pdf sharing.pdf
clean:
rm -f pygpu_ndarray.so core.* *.o *~
cleantmp:
rm -f core.* *.o *~
presentation.pdf: presentation.tex
pdflatex presentation
pdflatex presentation
sharing.pdf: sharing.tex
pdflatex sharing
pdflatex sharing
import numpy
import theano
import theano.tensor as tt
rng = numpy.random
N = 400
feats = 784
D = (rng.randn(N, feats), rng.randint(size=N, low=0, high=2))
training_steps = 10000
# Declare Theano symbolic variables
x = tt.matrix("x")
y = tt.vector("y")
w = theano.shared(rng.randn(feats), name="w")
b = theano.shared(0., name="b")
print "Initial model:"
print w.get_value(), b.get_value()
# Construct Theano expression graph
p_1 = 1 / (1 + tt.exp(-tt.dot(x, w) - b)) # Probability that target = 1
prediction = p_1 > 0.5 # The prediction thresholded
xent = -y * tt.log(p_1) - (1 - y) * tt.log(1 - p_1) # Cross-entropy loss
cost = xent.mean() + 0.01 * (w ** 2).sum() # The cost to minimize
gw, gb = tt.grad(cost, [w, b])
# Compile
train = theano.function(
inputs=[x, y],
outputs=[prediction, xent],
updates=[(w, w - 0.1 * gw),
(b, b - 0.1 * gb)],
name='train')
predict = theano.function(inputs=[x], outputs=prediction,
name='predict')
# Train
for i in range(training_steps):
pred, err = train(D[0], D[1])
print "Final model:"
print w.get_value(), b.get_value()
print "target values for D:", D[1]
print "prediction on D:", predict(D[0])
差异被折叠。
\documentclass[utf8x,xcolor=pdftex,dvipsnames,table]{beamer}
\usetheme{Malmoe} % Now it's a beamer presentation with the lisa theme!
\setbeamertemplate{footline}[page number]
\usecolortheme{beaver}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[utf8x]{inputenc}
%\logo{\includegraphics[width=.8in]{UdeM_NoirBleu_logo_Marie_crop}}
\usepackage{listings}
\newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}
\mode<presentation>
\title{Theano, Pylearn2, libgpuarray: Sharing and Future}
\author{%
\footnotesize
Frédéric Bastien, Bart van Merriënboer \newline
Département d'Informatique et de Recherche Opérationnelle \newline
Université de Montréal \newline
Montréal, Canada \newline
\texttt{\{bastienf, vanmerb\}@iro.umontreal.ca} \newline \newline
}
\date{OML Workshop 2014}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\begin{frame}[plain]
\titlepage
\vspace{-5em}
\includegraphics[width=1in]{../hpcs2011_tutorial/pics/lisabook_logo_text_3.png}
\hfill
\includegraphics[width=.8in]{../hpcs2011_tutorial/pics/UdeM_NoirBleu_logo_Marie_crop}
\end{frame}
\section{Future}
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
\begin{frame}{Theano}\setcounter{page}{1}
\begin{itemize}
\item Easier C code development and better documentation of that
\item Faster compilation
\item Multi-GPU
\item Better looping (update to scan)
\item Allow checkpoint with GPU to reload without GPU
\item Less memory allocation(lower Theano overhead)
\item Faster convolution
\end{itemize}
\end{frame}
\begin{frame}{libgpuarray}
\begin{itemize}
\item Find other projects to use it?
\item More functionality as NumPy
\item Move some of the functionality from Python/Theano to the C level
\item Optimize the kernel selection and parametrization based on the GPU
\end{itemize}
\end{frame}
\begin{frame}{Pylearn2}
\begin{itemize}
\item RNN
\item Better hyperparameter search support, using e.g. Hyperopt
\item Documentation
\item Checkpoint
\item Better support for sparse dataset
\item Machine translation examples
\item Gated activations for conditional computation
\item Variational Auto-Encoders
\end{itemize}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}{Simplifying code sharing between}
\begin{enumerate}
\item<1-> License: \begin{bf}Suggest BSD\end{bf} as it is used by many software in our field.
\begin{itemize}
\item Common license help share code.
\item When reusing code, don't forget to keep the license and the copyright notice
\end{itemize}
\item<2-> Common base object! \begin{bf}libgpuarray\end{bf}
\item<3-> Otherwise: put important implementation(e.g. convolution) in \begin{bf}separate file\end{bf} and \begin{bf}use raw ptr/shape/strides\end{bf} as inputs. Document that interface.
\item<4-> Acknowledge reuse \begin{bf}in section on web site\end{bf} AND \begin{bf}in papers\end{bf} about the software we reuse! (and use too)
\end{enumerate}
\end{frame}
\end{document}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论